pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1688513 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java
Date Tue, 30 Jun 2015 20:02:46 GMT
Author: tilman
Date: Tue Jun 30 20:02:46 2015
New Revision: 1688513

URL: http://svn.apache.org/r1688513
Log:
PDFBOX-2847: use scratchFile for mergeDocumentsNonSeq, as suggested by Jim deVos

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java?rev=1688513&r1=1688512&r2=1688513&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java Tue
Jun 30 20:02:46 2015
@@ -167,9 +167,10 @@ public class PDFMergerUtility
      * Merge the list of source documents, saving the result in the destination
      * file.
      *
+     * @param useScratchFiles enables the usage of a scratch file if set to true
      * @throws IOException If there is an error saving the document.
      */
-    public void mergeDocuments() throws IOException
+    public void mergeDocuments(boolean useScratchFiles) throws IOException
     {
         PDDocument destination = null;
         InputStream sourceFile;
@@ -181,12 +182,12 @@ public class PDFMergerUtility
             try
             {
                 Iterator<InputStream> sit = sources.iterator();
-                destination = new PDDocument();
+                destination = new PDDocument(useScratchFiles);
 
                 while (sit.hasNext())
                 {
                     sourceFile = sit.next();
-                    source = PDDocument.load(sourceFile);
+                    source = PDDocument.load(sourceFile, useScratchFiles);
                     tobeclosed.add(source);
                     appendDocument(destination, source);
                 }



Mime
View raw message