pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1850125 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java
Date Tue, 01 Jan 2019 21:16:24 GMT
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



Mime
View raw message