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/04/05 18:33:06 UTC

svn commit: r1857027 - in /pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox: pdfwriter/COSWriter.java pdmodel/PDDocument.java

Author: tilman
Date: Fri Apr  5 18:33:06 2019
New Revision: 1857027

URL: http://svn.apache.org/viewvc?rev=1857027&view=rev
Log:
PDFBOX-45: change parameter to dictionary set; improve javadoc

Modified:
    pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java
    pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java

Modified: pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java?rev=1857027&r1=1857026&r2=1857027&view=diff
==============================================================================
--- pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java (original)
+++ pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java Fri Apr  5 18:33:06 2019
@@ -256,7 +256,9 @@ public class COSWriter implements ICOSVi
     /**
      * COSWriter constructor for incremental updates with a list of objects to write. This allows to
      * include objects even if there is no path of objects that have
-     * {@link COSUpdateInfo#isNeedToBeUpdated()} set. This makes the update smaller.
+     * {@link COSUpdateInfo#isNeedToBeUpdated()} set so the incremental update gets smaller. Only
+     * dictionaries are supported; if you need to update other objects classes, then add their
+     * parent dictionary.
      *
      * @param outputStream output stream where the new PDF data will be written. It will be closed
      * when this object is closed.
@@ -265,7 +267,7 @@ public class COSWriter implements ICOSVi
      * @throws IOException if something went wrong
      */
     public COSWriter(OutputStream outputStream, RandomAccessRead inputData,
-            List<COSBase> objectsToWrite) throws IOException
+            Set<COSDictionary> objectsToWrite) throws IOException
     {
         this(outputStream, inputData);
         this.objectsToWrite.addAll(objectsToWrite);

Modified: pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java?rev=1857027&r1=1857026&r2=1857027&view=diff
==============================================================================
--- pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java (original)
+++ pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java Fri Apr  5 18:33:06 2019
@@ -44,6 +44,7 @@ import org.apache.pdfbox.cos.COSInteger;
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.cos.COSNumber;
 import org.apache.pdfbox.cos.COSObject;
+import org.apache.pdfbox.cos.COSUpdateInfo;
 import org.apache.pdfbox.io.IOUtils;
 import org.apache.pdfbox.io.MemoryUsageSetting;
 import org.apache.pdfbox.io.RandomAccessBuffer;
@@ -1350,7 +1351,6 @@ public class PDDocument implements Close
      * @throws IOException if the output could not be written
      * @throws IllegalStateException if the document was not loaded from a file or a stream.
      */
-    
     public void saveIncremental(OutputStream output) throws IOException
     {
         COSWriter writer = null;
@@ -1376,7 +1376,9 @@ public class PDDocument implements Close
      * Save the PDF as an incremental update. This is only possible if the PDF was loaded from a
      * file or a stream, not if the document was created in PDFBox itself. This allows to include
      * objects even if there is no path of objects that have
-     * {@link COSUpdateInfo#isNeedToBeUpdated()} set. This makes the update smaller.
+     * {@link COSUpdateInfo#isNeedToBeUpdated()} set so the incremental update gets smaller. Only
+     * dictionaries are supported; if you need to update other objects classes, then add their
+     * parent dictionary.
      *
      * @param output stream to write to. It will be closed when done. It
      * <i><b>must never</b></i> point to the source file or that one will be harmed!
@@ -1384,7 +1386,7 @@ public class PDDocument implements Close
      * @throws IOException if the output could not be written
      * @throws IllegalStateException if the document was not loaded from a file or a stream.
      */
-    public void saveIncremental(OutputStream output, List<COSBase> objectsToWrite) throws IOException
+    public void saveIncremental(OutputStream output, Set<COSDictionary> objectsToWrite) throws IOException
     {
         if (pdfSource == null)
         {