PDF/A (ISO 19005)
Overview
PDF/A is a standard which turns PDF into an "electronic document file format for long-term preservation". PDF/A-1 is the first part of the standard and is documented in ISO 19005-1:2005(E). Work on PDF/A-2 is in progress at AIIM.
Design documentation on PDF/A can be found on FOP's Wiki on the PDFA1ConformanceNotes page.
Implementation Status
PDF/A-1b is implemented to the degree that FOP supports the creation of the elements described in ISO 19005-1.
There is a restriction with XMP metadata. If an XMP metadata packet is present in the fo:declarations element of an FO file, the values from the XMP packet are not synchronized with the Info PDF object as is mandated by chapter 6.7.3 of the ISO document. However, if no XMP packet is supplied FOP automatically generates an XMP packet from the values in the Info PDF object.
Tests have been performed against jHove and Adobe Acrobat 7.0.7 (Preflight function).
PDF/A-1a is not implemented, yet. This is mostly because of the requirement for tagged PDF which is not available in FOP, yet.
Usage (command line)
If you specify "-pdfa1b" instead of "-pdf" for the output format on the command line, support for PDF/A-1b is activated. If there is a violation of one of the validation rules for PDF/A, an error message is presented and the processing stops.
Usage (embedded)
When FOP is embedded in another Java application you can set a special option on the renderer options in the user agent to activate the PDF/A-1b profile. Here's an example:
FOUserAgent userAgent = fopFactory.newFOUserAgent(); userAgent.getRendererOptions().put("pdf-a-mode", "PDF/A-1b"); Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent); [..]
If one of the validation rules of PDF/A is violated, an PDFConformanceException (descendant of RuntimeException) is thrown.
PDF/A in Action
There are a number of things that must be looked after if you activate a PDF/A profile. If you receive a PDFConformanceException, have a look at the following list (not necessarily comprehensive):
- Make sure all (!) fonts are embedded. If you use base 14 fonts (like Helvetica) you need to obtain a license for them and embed them like any other font.
- Don't use PDF encryption. PDF/A doesn't allow it.
- Don't use CMYK images without an ICC color profile. PDF/A doesn't allow mixing color spaces and FOP currently only properly supports the sRGB color space. Please note that FOP embeds a standard sRGB ICC profile (sRGB IEC61966-2.1) as the primary output intent for the PDF.
- Don't use non-RGB colors in SVG images. Same issue as with CMYK images.
- Don't use EPS graphics with fo:external-graphic. Embedding EPS graphics in PDF is deprecated since PDF 1.4 and prohibited by PDF/A.
- PDF is forced to version 1.4 if PDF/A-1 is activated.
- No filter must be specified explicitely for metadata objects. Metadata must be embedded in clear text so non-PDF-aware applications can extract the XMP metadata.
by Jeremias Märki