summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fop-core/src/main/java/org/apache/fop/pdf/PDFResources.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFResources.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFResources.java
index e269ad361..af2c27d9f 100644
--- a/fop-core/src/main/java/org/apache/fop/pdf/PDFResources.java
+++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFResources.java
@@ -299,7 +299,10 @@ public class PDFResources extends PDFDictionary {
}
if (!this.colorSpaces.isEmpty() || (parent != null && !parent.colorSpaces.isEmpty())) {
- PDFDictionary dict = new PDFDictionary(this);
+ PDFDictionary dict = (PDFDictionary)this.get("ColorSpace");
+ if (dict == null) {
+ dict = new PDFDictionary(this);
+ }
if (parent != null) {
for (PDFColorSpace colorSpace : parent.colorSpaces.values()) {
dict.put(colorSpace.getName(), colorSpace);