Skip to content

Commit 215804c

Browse files
committed
PDFBOX-6019: ignore orphan markup annotations
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1926338 13f79535-47bb-0310-9956-ffa450edef68
1 parent 65d723f commit 215804c

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -957,24 +957,8 @@ private void processAnnotations(PDPage imported) throws IOException
957957
continue;
958958
}
959959
COSDictionary clonedMarkupDict = annotDictMap.get(annotationMarkup.getCOSObject());
960-
if (clonedMarkupDict != null)
961-
{
962-
annotation.getCOSObject().setItem(COSName.PARENT, clonedMarkupDict);
963-
}
964-
else
965-
{
966-
// orphan markup (not in annotation list); clone it and fix references
967-
clonedMarkupDict = new COSDictionary(annotationMarkup.getCOSObject());
968-
annotDictMap.put(annotationMarkup.getCOSObject(), clonedMarkupDict);
969-
PDAnnotationMarkup annotationMarkupClone =
970-
(PDAnnotationMarkup) PDAnnotation.createAnnotation(clonedMarkupDict);
971-
annotationMarkupClone.setPopup((PDAnnotationPopup) annotation);
972-
((PDAnnotationPopup) annotation).setParent(annotationMarkupClone);
973-
if (annotationMarkupClone.getPage() != null)
974-
{
975-
annotationMarkupClone.setPage(imported);
976-
}
977-
}
960+
// clonedMarkupDict will be null if markup annotation is an orphan (not in annotation list)
961+
annotation.getCOSObject().setItem(COSName.PARENT, clonedMarkupDict);
978962
}
979963
}
980964
imported.setAnnotations(clonedAnnotations);

0 commit comments

Comments
 (0)