Skip to content

Commit

Permalink
Merge pull request #590 from veraPDF/wcag_destination
Browse files Browse the repository at this point in the history
WCAG. Update getDestination for annotation
  • Loading branch information
MaximPlusov authored Oct 11, 2023
2 parents 590ce24 + e3f2498 commit 31875c4
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private static COSObject getDestination(PDAnnotation annot, ASAtom key) {
if (destination == null || destination.empty()) {
return null;
}
if (destination.getType() == COSObjType.COS_STRING || destination.getType() == COSObjType.COS_NAME) {
if (destination.getType() == COSObjType.COS_STRING) {
PDNamesDictionary namesDictionary = StaticResources.getDocument().getCatalog().getNamesDictionary();
if (namesDictionary == null) {
return null;
Expand All @@ -96,9 +96,17 @@ private static COSObject getDestination(PDAnnotation annot, ASAtom key) {
return null;
}
}
} else if (destination.getType() == COSObjType.COS_NAME) {
COSObject dests = StaticResources.getDocument().getCatalog().getDests();
if (dests != null) {
destination = dests.getKey(destination.getDirectBase().getName());
if (destination == null) {
return null;
}
}
}
if (destination.getType() == COSObjType.COS_DICT) {
destination = destination.getKey(ASAtom.D);
destination = destination.getKey(key);
}
COSObject obj = null;
if (destination.getType() == COSObjType.COS_ARRAY && destination.size() > 0) {
Expand Down

0 comments on commit 31875c4

Please sign in to comment.