Skip to content

Commit 4a75d5a

Browse files
LonelyMidoriyaMaximPlusov
authored andcommitted
Remove StructParent from annotation that are artifacts
1 parent eac53ed commit 4a75d5a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/processors/AutoTaggingProcessor.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,12 @@ private static void processAnnotations(PDDocument document, COSDocument cosDocum
419419
annotObj.setKey(ASAtom.STRUCT_PARENT, COSInteger.construct(structParentInt));
420420
cosDocument.addChangedObject(annotObj);
421421
pageChanged = true;
422+
} else {
423+
if (annotation.knownKey(ASAtom.STRUCT_PARENT)) {
424+
annotation.removeKey(ASAtom.STRUCT_PARENT);
425+
cosDocument.addChangedObject(annotObj);
426+
pageChanged = true;
427+
}
422428
}
423429
}
424430
// Flush the Annots array (may be an indirect object separate from the page)

0 commit comments

Comments
 (0)