Skip to content

Commit

Permalink
Merge pull request #326 from veraPDF/pdfua2
Browse files Browse the repository at this point in the history
PDF/UA-2. Add getaltPresent to PBGlyph.
  • Loading branch information
MaximPlusov authored Oct 23, 2023
2 parents 8f77b35 + b5b7df3 commit a076105
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -61,6 +61,7 @@ public abstract class PBOpMarkedContent extends PBOperator implements
public static final String LANG = "Lang";
/** Name of link to ActualText value from the properties dictionary */
public static final String ACTUAL_TEXT = "actualText";
public static final String ALT = "alt";

public PBOpMarkedContent(List<COSBase> arguments, final String opType, PDDocument document, PDFAFlavour flavour) {
super(arguments, opType);
@@ -88,6 +89,8 @@ public List<? extends Object> getLinkedObjects(String link) {
switch (link) {
case ACTUAL_TEXT:
return this.getactualText();
case ALT:
return Collections.emptyList();
default:
return super.getLinkedObjects(link);
}
Original file line number Diff line number Diff line change
@@ -152,4 +152,9 @@ public Boolean getactualTextPresent() {
// actual text obtaining should be implemented
return Boolean.FALSE;
}

@Override
public Boolean getaltPresent() {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -81,6 +81,7 @@ public class PBoxPDStructElem extends PBoxPDObject implements PDStructElem {
* Link name for {@code ActualText} key
*/
public static final String ACTUAL_TEXT = "actualText";
public static final String ALT = "alt";

private TaggedPDFRoleMapHelper roleMapHelper;

@@ -267,7 +268,9 @@ public List<? extends Object> getLinkedObjects(String link) {
case LANG:
return this.getLang();
case ACTUAL_TEXT:
return this.getactualText();
return this.getactualText();
case ALT:
return Collections.emptyList();
default:
return super.getLinkedObjects(link);
}

0 comments on commit a076105

Please sign in to comment.