pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1769047 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/PDTilingPattern.java
Date Thu, 10 Nov 2016 06:15:21 GMT
Author: tilman
Date: Thu Nov 10 06:15:21 2016
New Revision: 1769047

URL: http://svn.apache.org/viewvc?rev=1769047&view=rev
Log:
PDFBOX-3561: must be a stream, not a dictionary; must initialized with resources

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/PDTilingPattern.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/PDTilingPattern.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/PDTilingPattern.java?rev=1769047&r1=1769046&r2=1769047&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/PDTilingPattern.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/PDTilingPattern.java
Thu Nov 10 06:15:21 2016
@@ -43,7 +43,7 @@ public class PDTilingPattern extends PDA
     /** tiling type 1 = constant spacing.*/
     public static final int TILING_CONSTANT_SPACING = 1;
 
-    /**  tiling type 2 = no distortion. */
+    /** tiling type 2 = no distortion. */
     public static final int TILING_NO_DISTORTION = 2;
 
     /** tiling type 3 = constant spacing and faster tiling. */
@@ -54,7 +54,12 @@ public class PDTilingPattern extends PDA
      */
     public PDTilingPattern()
     {
+        super(new COSStream());
+        getCOSObject().setName(COSName.TYPE, COSName.PATTERN.getName());
         getCOSObject().setInt(COSName.PATTERN_TYPE, PDAbstractPattern.TYPE_TILING_PATTERN);
+        
+        // Resources required per PDF specification; when missing, pattern is not displayed
in Adobe Reader
+        setResources(new PDResources());
     }
 
     /**
@@ -186,7 +191,7 @@ public class PDTilingPattern extends PDA
      * This will set the resources for this pattern.
      * @param resources The new resources for this pattern.
      */
-    public void setResources( PDResources resources )
+    public final void setResources( PDResources resources )
     {
         getCOSObject().setItem(COSName.RESOURCES, resources);
     }



Mime
View raw message