Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF/UA-2. Add getaltPresent to PBGlyph. #326

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
Expand Down
Loading