diff --git a/wcag-validation/src/main/java/org/verapdf/gf/model/impl/sa/GFSAAnnotationNode.java b/wcag-validation/src/main/java/org/verapdf/gf/model/impl/sa/GFSAAnnotationNode.java index a09408924..fe49f87a9 100644 --- a/wcag-validation/src/main/java/org/verapdf/gf/model/impl/sa/GFSAAnnotationNode.java +++ b/wcag-validation/src/main/java/org/verapdf/gf/model/impl/sa/GFSAAnnotationNode.java @@ -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; @@ -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) {