diff options
author | Jeremias Maerki <jeremias@apache.org> | 2006-04-05 14:21:39 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2006-04-05 14:21:39 +0000 |
commit | d1c0afa0a3a277b02c7301c37fd6b9fb34f0d2ba (patch) | |
tree | 50175cf4652eb077bb84db07cfc363cd498dac79 /src/java/org/apache/fop/pdf/PDFRoot.java | |
parent | 05ff967d64a3050a5ce08cc435bd91844efcf89d (diff) | |
download | xmlgraphics-fop-d1c0afa0a3a277b02c7301c37fd6b9fb34f0d2ba.tar.gz xmlgraphics-fop-d1c0afa0a3a277b02c7301c37fd6b9fb34f0d2ba.zip |
Improved JUnit report creation.
Added support for OutputIntent objects in PDF. When PDF/A-1b is activated OutputIntents are created and the sRGB color space is used by default (hardcoded for the moment for lack of better color infrastructure in FOP).
The sRGB color profile from HP (covering sRGB IEC61966-2.1) is now embedded in fop.jar as a resource so the PDF library can embed it. The sRGB profile from the Sun JRE is much bigger. That's why it's not used.
The Gladiator TrueType font (glb12.ttf) has been copied over from Batik and is used to verify PDF/A-1b's conformance checks.
CMYK JPEG image added to test resources so PDF/A-1b color space checks can be performed.
With the color space checks, support for PDF/A-1b is complete to the degree that FOP supports the creation of elements described in ISO 19005-1, except for the case where an embedded XMP packet is used in the fo:declarations element. In this case the metadata is not synchronized with the values in the Info PDF object which could lead to validation errors when checking for PDF/A-1b conformance.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@391624 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/pdf/PDFRoot.java')
-rw-r--r-- | src/java/org/apache/fop/pdf/PDFRoot.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/pdf/PDFRoot.java b/src/java/org/apache/fop/pdf/PDFRoot.java index 3d483f587..9ac4e1b0f 100644 --- a/src/java/org/apache/fop/pdf/PDFRoot.java +++ b/src/java/org/apache/fop/pdf/PDFRoot.java @@ -18,6 +18,8 @@ package org.apache.fop.pdf; +import java.util.List; + /** * class representing a Root (/Catalog) object */ @@ -56,6 +58,9 @@ public class PDFRoot extends PDFObject { /** Optional Metadata object */ private PDFMetadata metadata; + /** The array of OutputIntents */ + private List outputIntents; + private int pageMode = PAGEMODE_USENONE; /** @@ -137,6 +142,17 @@ public class PDFRoot extends PDFObject { } /** + * Adds an OutputIntent to the PDF + * @param outputIntent the OutputIntent dictionary + */ + public void addOutputIntent(PDFOutputIntent outputIntent) { + if (this.outputIntents == null) { + this.outputIntents = new java.util.ArrayList(); + } + this.outputIntents.add(outputIntent); + } + + /** * @see org.apache.fop.pdf.PDFObject#toPDFString() */ public String toPDFString() { @@ -168,6 +184,19 @@ public class PDFRoot extends PDFObject { && getDocumentSafely().getPDFVersion() >= PDFDocument.PDF_VERSION_1_4) { p.append("/Metadata " + getMetadata().referencePDF() + "\n"); } + if (this.outputIntents != null + && this.outputIntents.size() > 0 + && getDocumentSafely().getPDFVersion() >= PDFDocument.PDF_VERSION_1_4) { + p.append("/OutputIntents ["); + for (int i = 0, c = this.outputIntents.size(); i < c; i++) { + PDFOutputIntent outputIntent = (PDFOutputIntent)this.outputIntents.get(i); + if (i > 0) { + p.append(" "); + } + p.append(outputIntent.referencePDF()); + } + p.append("]\n"); + } p.append(">>\nendobj\n"); return p.toString(); } |