From b36aeb2cb850c0cf1ae70efaeea3c2e06c32b8a1 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Tue, 15 Jun 2010 08:55:40 +0000 Subject: [PATCH] Put the /Resources reference directly into the underlying dictionary and handle null cases since /Resources is optional on a Form XObject. 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/fop/pdf/PDFFormXObject.java b/src/java/org/apache/fop/pdf/PDFFormXObject.java index 5ede9b487..2ccc17086 100644 --- a/src/java/org/apache/fop/pdf/PDFFormXObject.java +++ b/src/java/org/apache/fop/pdf/PDFFormXObject.java @@ -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); } -- 2.39.5