You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2019/01/01 21:16:24 UTC

svn commit: r1850125 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java

Author: tilman
Date: Tue Jan  1 21:16:24 2019
New Revision: 1850125

URL: http://svn.apache.org/viewvc?rev=1850125&view=rev
Log:
PDFBOX-4071: add comment suggesting optimization strategy if poor performance drawback in viewers

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java?rev=1850125&r1=1850124&r2=1850125&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java Tue Jan  1 21:16:24 2019
@@ -804,7 +804,13 @@ public class PDFMergerUtility
             }
             destParentTreeNextKey += maxSrcKey + 1;
             PDNumberTreeNode newParentTreeNode = new PDNumberTreeNode(PDParentTreeValue.class);
+
+            // Note that all elements are stored flatly. This could become a problem for large files
+            // when these are opened in a viewer that uses the tagging information.
+            // If this happens, then ​PDNumberTreeNode should be improved with a convenience method that
+            // stores the map into a B+Tree, see https://en.wikipedia.org/wiki/B+_tree
             newParentTreeNode.setNumbers(destNumberTreeAsMap);
+
             destStructTree.setParentTree(newParentTreeNode);
             destStructTree.setParentTreeNextKey(destParentTreeNextKey);
 
@@ -905,6 +911,10 @@ public class PDFMergerUtility
         destIDTree = new PDStructureElementNameTreeNode();
         destIDTree.setNames(destNames);
         destStructTree.setIDTree(destIDTree);
+        // Note that all elements are stored flatly. This could become a problem for large files
+        // when these are opened in a viewer that uses the tagging information.
+        // If this happens, then PDNameTreeNode should be improved with a convenience method that
+        // stores the map into a B+Tree, see https://en.wikipedia.org/wiki/B+_tree
     }
 
     // PDNameTreeNode.getNames() only brings one level, this is why we need this