pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1783623 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java
Date Sun, 19 Feb 2017 10:50:43 GMT
Author: tilman
Date: Sun Feb 19 10:50:42 2017
New Revision: 1783623

URL: http://svn.apache.org/viewvc?rev=1783623&view=rev
Log:
PDFBOX-3684: avoid setDirect on dictionary that references itself

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java?rev=1783623&r1=1783622&r2=1783623&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java Sun Feb 19
10:50:42 2017
@@ -1008,13 +1008,14 @@ public class COSWriter implements ICOSVi
                     if (!incrementalUpdate)
                     {            
                         // write all XObjects as direct objects, this will save some size
+                        // PDFBOX-3684: but avoid dictionary that references itself
                         COSBase item = dict.getItem(COSName.XOBJECT);
-                        if (item != null)
+                        if (item != null && !COSName.XOBJECT.equals(entry.getKey()))
                         {
                             item.setDirect(true);
                         }
                         item = dict.getItem(COSName.RESOURCES);
-                        if (item != null)
+                        if (item != null && !COSName.RESOURCES.equals(entry.getKey()))
                         {
                             item.setDirect(true);
                         }



Mime
View raw message