You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by GitBox <gi...@apache.org> on 2023/01/13 09:55:03 UTC

[GitHub] [pdfbox] bernhardf-ro commented on a diff in pull request #149: Allow negative struct parent keys in PDFMergerUtility

bernhardf-ro commented on code in PR #149:
URL: https://github.com/apache/pdfbox/pull/149#discussion_r1069164981


##########
pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java:
##########
@@ -1498,8 +1499,8 @@ private void updateStructParentEntries(PDPage page, int structParentOffset) thro
         List<PDAnnotation> newannots = new ArrayList<>(annots.size());
         annots.forEach(annot ->
         {
-            int structParent = annot.getStructParent();
-            if (structParent >= 0)
+            int structParent = annot.getCOSObject().getInt(COSName.STRUCT_PARENT, Integer.MIN_VALUE); // allow for negative struct parent values

Review Comment:
   I intentionally kept the patch to one class and as simple and minimal as possible, e.g. not renaming variables. So feel free to adapt it and let me know if you have any questions.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org