]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Put the /Resources reference directly into the underlying dictionary and handle null...
authorJeremias Maerki <jeremias@apache.org>
Tue, 15 Jun 2010 08:55:40 +0000 (08:55 +0000)
committerJeremias Maerki <jeremias@apache.org>
Tue, 15 Jun 2010 08:55:40 +0000 (08:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@954765 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/pdf/PDFFormXObject.java

index 5ede9b48752366e7e39758ba8c925e2224baa390..2ccc170860302b9ee97a79a1281db69e517468e4 100644 (file)
@@ -34,7 +34,6 @@ import java.io.OutputStream;
 public class PDFFormXObject extends PDFXObject {
 
     private PDFStream contents;
-    private PDFReference resRef;
 
     /**
      * create a FormXObject with the given number and name and load the
@@ -47,13 +46,15 @@ public class PDFFormXObject extends PDFXObject {
     public PDFFormXObject(int xnumber, PDFStream contents, PDFReference resources) {
         super();
         put("Name", new PDFName("Form" + xnumber));
-        this.resRef = resources;
         this.contents = contents;
 
         put("Type", new PDFName("XObject"));
         put("Subtype", new PDFName("Form"));
         put("FormType", new Integer(1));
         setMatrix(new AffineTransform());
+        if (resources != null) {
+            put("Resources", resources);
+        }
     }
 
     /**
@@ -172,7 +173,6 @@ public class PDFFormXObject extends PDFXObject {
         if (get("Matrix") == null) {
             put("Matrix", new PDFArray(this, new int[] {1, 0, 0, 1, 0, 0}));
         }
-        put("Resources", resRef);
         super.populateStreamDict(lengthEntry);
     }