Skip to content

Commit

Permalink
Update GFPDExtGState methods
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximPlusov committed Jul 9, 2024
1 parent f34c5ee commit c04809c
Showing 1 changed file with 27 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,6 @@ public GFPDExtGState(org.verapdf.pd.PDExtGState state) {
super(state, EXT_G_STATE_TYPE);
}

@Override
public String getTR() {
return getStringProperty(((org.verapdf.pd.PDExtGState) simplePDObject).getCOSTR());
}

@Override
public String getTR2() {
return getStringProperty(((org.verapdf.pd.PDExtGState) simplePDObject).getCOSTR2());
}

@Override
public String getSMask() {
return getStringProperty(((org.verapdf.pd.PDExtGState) simplePDObject).getCOSSMask());
}

@Override
public String getBM() {
return getStringProperty(((org.verapdf.pd.PDExtGState) simplePDObject).getCOSBM());
}

private List<CosBM> getlinkBM() {
COSObject BM = ((org.verapdf.pd.PDExtGState)simplePDObject).getCOSBM();
if (BM == null || BM.empty() || BM.getType() == COSObjType.COS_NULL) {
Expand Down Expand Up @@ -130,17 +110,19 @@ public Double getCA() {
return 2.0; // check is failed
}

private static String getStringProperty(COSObject property) {
if (property == null
|| property.empty()
|| property.getType() == COSObjType.COS_NULL) {
return null;
}
@Override
public String getTR2NameValue() {
return simplePDObject.getNameKeyStringValue(ASAtom.TR2);
}

if (property.getType() == COSObjType.COS_NAME) {
return property.getName().getValue();
}
return property.toString();
@Override
public Boolean getcontainsTR() {
return simplePDObject.knownKey(ASAtom.TR);
}

@Override
public Boolean getcontainsTR2() {
return simplePDObject.knownKey(ASAtom.TR2);
}

@Override
Expand All @@ -153,6 +135,21 @@ public Boolean getcontainsHTO() {
return this.simplePDObject.knownKey(ASAtom.HTO);
}

@Override
public String getSMaskNameValue() {
return simplePDObject.getNameKeyStringValue(ASAtom.SMASK);
}

@Override
public Boolean getcontainsSMask() {
return simplePDObject.knownKey(ASAtom.SMASK);
}

@Override
public String getBMNameValue() {
return simplePDObject.getNameKeyStringValue(ASAtom.BM);
}

@Override
public List<? extends Object> getLinkedObjects(String link) {
switch (link) {
Expand Down

0 comments on commit c04809c

Please sign in to comment.