59
9.4 PDF/X for Print Production 203
>Additional rules apply when importing pages from existing PDF/X-conforming doc-
uments (see Section 9.4.3, »Importing PDF/X Documents with PDI«, page 205).
Cookbook A full code sample can be found in the Cookbook topic pdf_flavors/starter_pdfx.
Required operations. Table 9.5 lists all operations required to generate PDF/X-con-
forming output. The items apply to all PDF/X conformance levels unless otherwise not-
ed. Not calling one of the required functions while in PDF/X mode will trigger an excep-
tion.
Prohibited operations. Table 9.6 lists all operations which are prohibited when gener-
ating PDF/X-conforming output. The items apply to all PDF/X conformance levels un-
less otherwise noted. Calling one of the prohibited functions while in PDF/X mode will
trigger an exception. Similarly, if an imported PDF page doesn’t match the current PDF/
X conformance level, the corresponding PDI call will fail
Standard output conditions. The output condition defines the intended target device,
which is mainly useful for reliable proofing. The output intent can either be specified
by an ICC profile or by supplying the name of a standard output intent. The standard
output intents are known internally to PDFlib (see PDFlib Reference for a complete list
Table 9.5 Operations which must be applied for PDF/X compatibility
item
PDFlib function and option requirements for PDF/X compatibility
conformance level
The pdfx option in PDF_begin_document( ) must be set to the desired PDF/X conformance level.
output condition
(output intent)
PDF_load_iccprofile( ) with usage=outputintent or PDF_process_pdi( ) with action=copy-
outputintent (but not both methods) must be called immediately after PDF_begin_document( ).
If HKS or Pantone spot colors, ICC-based colors, or Lab colors are used, an output device ICC profile
must be embedded; using a standard output condition is not allowed in this case.
PDF/X-1a: the output device must be a monochrome or CMYK device;
PDF/X-3: the output device must be a monochrome, RGB, or CMYK device.
font embedding
Set the embedding option of PDF_load_font( )
(and other functions which accept this option) to
true to enable font embedding. Note that embedding is also required for the PDF core fonts.
page sizes
The page boxes, which are settable via the cropbox, bleedbox, trimbox, and artbox options,
must satisfy all of the following requirements:
>
The TrimBox or ArtBox must be set, but not both of these box entries. If both TrimBox and Art-
Box are missing PDFlib will take the CropBox (if present) as the TrimBox, and the MediaBox if
the CropBox is also missing.
>
The BleedBox, if present, must fully contain the ArtBox and TrimBox.
>
The CropBox, if present, must fully contain the ArtBox and TrimBox.
grayscale color
PDF/X-3: the defaultgray option in PDF_begin_page_ext( ) must be set if grayscale images are
used or PDF_setcolor( ) is used with a gray color space, and the PDF/X output condition is not a
CMYK or grayscale device.
RGB color
PDF/X-3: the defaultrgb option in PDF_begin_page_ext( ) must be set if RGB images are used or
PDF_setcolor( ) is used with an RGB color space, and the PDF/X output condition is not an RGB de-
vice.
CMYK color
PDF/X-3: the defaultcmyk option in PDF_begin_page_ext( ) must be set if CMYK images are used
or PDF_setcolor( ) is used with a CMYK color space, and the PDF/X output condition is not a CMYK
device.
document info keys
The Creator and Title info keys must be set with PDF_set_info( ).
75
204
Chapter 9: Generating various PDF Flavors
of the names and the corresponding printing conditions). Standard output intents can
be referenced as follows:
p.load_iccprofile("CGATS TR 001", "usage=outputintent");
When creating PDF/X-3 output and using any of HKS, PANTONE, ICC-based, or Lab colors
the use of standard output intents is not allowed, but an ICC profile of the output device
must be embedded instead.
Additional standard output intents can be defined using the StandardOutputIntent
resource category (see Section 3.1.3, »Resource Configuration and File Searching«, page
48). It is the user’s responsibility to add only those names as standard output intents
which can be recognized by PDF/X-processing software.
Table 9.6 Operations which must be avoided or are restricted to achieve PDF/X compatibility
item
Prohibited or restricted PDFlib functions and options for PDF/X compatibility
grayscale color
PDF/X-1a: the defaultgray option in PDF_begin_page_ext( ) must be avoided.
RGB color
PDF/X-1a: RGB images and the defaultrgb option in PDF_begin_page_ext( ) must be avoided.
CMYK color
PDF/X-1a: the defaultcmyk option in PDF_begin_page_ext( ) must be avoided.
ICC-based color
PDF/X-1a: the iccbasedgray/rgb/cmyk color space in PDF_setcolor( ) and the setcolor:icc-
profilegray/rgb/cmyk parameters must be avoided.
Lab color
PDF/X-1a: the Lab color space in PDF_setcolor( ) must be avoided.
annotations and
form fields
Annotations inside the BleedBox (or TrimBox/ArtBox if no BleedBox is present) must be avoided:
PDF_
create_annotation( ),
PDF_
create_field( ) and related deprecated functions.
actions and
JavaScript
All actions including JavaScript must be avoided:
PDF_
create_action( ), and related deprecated
functions
images
PDF/X-1a: images with RGB, ICC-based, YCbCr, or Lab color must be avoided. For colorized images
the alternate color of the spot color used must satisfy the same conditions.
The OPI-1.3 and OPI-2.0 options in
PDF_
load_image( ) must be avoided.
transparency
Soft masks for images must be avoided: the masked option for
PDF_
load_image( ) must be avoid-
ed unless the mask refers to a 1-bit image.
The opacityfill and opacitystroke options for
PDF_
create_gstate( ) must be avoided unless
they have a value of 1.
viewer preferences /
view and print areas
When the viewarea, viewclip, printarea, and printclip keys are used for
PDF_
set_parameter( )
values other than media or bleed are not allowed.
document info keys Trapped info key values other than True or False for PDF_set_info( ) must be avoided.
security
PDF/X-1a and PDF/X-3: userpassword, masterpassword, and permissions options in
PDF_
begin_
document( ) must be avoided.
PDF version /
compatibility
PDF/X-1a:2001 and PDF/X-3:2002 are based on PDF 1.3. Operations that require PDF 1.4 or above
(such as transparency or soft masks) must be avoided.
PDF/X-1a:2003, PDF/X-2:2003, and PDF/X-3:2003 are based on PDF 1.4. Operations that require
PDF 1.5 (such as layers) must be avoided.
PDF import (PDI)
Imported documents must conform to a compatible PDF/X level according to Table 9.8, and must
have been prepared according to the same output intent.
74
9.4 PDF/X for Print Production 205
Selecting a suitable PDF/X output intent. The PDF/X output intent is usually selected
as a result of discussions between you and your print service provider who will take care
of print production. If your printer cannot provide any information regarding the
choice of output intent, you can use the standard output intents listed in Table 9.7 as a
starting point (taken from the PDF/X FAQ).
9.4.3 Importing PDF/X Documents with PDI
Special rules apply when pages from an existing PDF document will be imported into a
PDF/X-conforming output document (see Section 6.2, »Importing PDF Pages with PDI
(PDF Import Library)«, page 130, for details on the PDF import library PDI). All imported
documents must conform to an acceptable PDF/X conformance level according to Table
9.8. As a general rule, input documents conforming to the same PDF/X conformance
level as the generated output document, or to an older version of the same level, are ac-
ceptable. In addition, certain other combinations are acceptable. If a certain PDF/X con-
formance level is configured in PDFlib and the imported documents adhere to one of
the acceptable levels, the generated output is guaranteed to comply with the selected
PDF/X conformance level. Imported documents which do not adhere to one of the ac-
ceptable PDF/X levels will be rejected.
If multiple PDF/X documents are imported, they must all have been prepared for the
same output condition. While PDFlib can correct certain items, it is not intended to
Table 9.7 Suitable PDF/X output intents for common printing situations
Europe
North America
Magazine ads
FOGRA28
CGATS TR 001 (SWOP)
Newsprint ads
IFRA26
IFRA30
Sheet-fed offset
Dependent on paper stock:
Types 1 & 2 (coated): FOGRA27
Type 3 (LWC): FOGRA28
Type 4 (uncoated): FOGRA29
Dependent on paper stock:
Grades 1 and 2 (premium coated): FOGRA27
Grade 5: CGATS TR 001 (SWOP)
Uncoated: FOGRA29
Web-fed offset
Dependent on paper stock:
Type 1 & 2 (coated): FOGRA28
Type 4 (uncoated, white): FOGRA29
Type 5 (uncoated, yellowish): FOGRA30
Dependent on paper stock:
Grade 5: CGATS TR 001 (SWOP)
Uncoated (white): FOGRA29
Uncoated (yellowish): FOGRA30
Table 9.8 Acceptable PDF/X input levels for various PDF/X output levels
PDF/X level of the imported document
PDF/X output level
PDF/X-1a:2001
PDF/X-1a:2003
PDF/X-2:2003
PDF/X-3:2002
PDF/X-3:2003
PDF/X-1a:2001
allowed
PDF/X-1a:2003
allowed
allowed
PDF/X-2:2003
allowed
allowed
allowed
allowed
allowed
PDF/X-3:2002
allowed
allowed
PDF/X-3:2003
allowed
allowed
allowed
allowed
24
206
Chapter 9: Generating various PDF Flavors
work as a full PDF/X validator or to enforce full PDF/X compatibility for imported docu-
ments. For example, PDFlib will not embed fonts which are missing from imported PDF
pages, and does not apply any color correction to imported pages.
If you want to combine imported pages such that the resulting PDF output docu-
ment conforms to the same PDF/X conformance level and output condition as the in-
put document(s), you can query the PDF/X status of the imported PDF as follows:
pdfxlevel = p.pcos_get_string(doc, "pdfx");
This statement will retrieve a string designating the PDF/X conformance level of the im-
ported document if it conforms to an ISO PDF/X level, or none otherwise. The returned
string can be used to set the PDF/X conformance level of the output document appro-
priately, using the pdfx option in PDF_begin_document( ).
Copying the PDF/X output intent from an imported document. In addition to query-
ing the PDF/X conformance level you can also copy the output intent from an imported
document:
ret = p.process_pdi(doc, -1, "action=copyoutputintent");
This can be used as an alternative to setting the output intent via PDF_load_iccprofile( ),
and will copy the imported document’s output intent to the generated output docu-
ment, regardless of whether it is defined by a standard name or an ICC profile. Copying
the output intent works for imported PDF/A and PDF/X documents.
The output intent of the generated output document must be set exactly once, ei-
ther by copying an imported document’s output intent, or by setting it explicitly using
PDF_load_iccprofile( ) with usage=outputintent.
40
9.5 PDF/A for Archiving 207
9.5 PDF/A for Archiving
9.5.1 The PDF/A Standards
The PDF/A formats specified in the ISO 19005 standard strive to provide a consistent
and robust subset of PDF which can safely be archived over a long period of time, or
used for reliable data exchange in enterprise and government environments.
PDF/A Competence Center. PDFlib GmbH is a founding
member of the PDF/A Competence Center. The aim of this
organization is to promote the exchange of information
and experience in the area of long-term archiving in ac-
cordance with ISO 19005. The members of the PDF/A Com-
petence Center actively exchange information related to the PDF/A standard and its im-
plementations, and conducts seminars and conference on the subject. For more
information refer to the PDF/A Competence Center Web site at www.pdfa.org.
PDF/A-1a:2005 and PDF/A-1b:2005 as defined in ISO 19005-1. PDF/A is targeted at reli-
able long-time preservation of digital documents. The standard is based on PDF 1.4, and
imposes some restrictions regarding the use of color, fonts, annotations, and other ele-
ments. There are two flavors of PDF/A-1, both of which can be created and processed
with PDFlib:
>ISO 19005-1 Level B conformance (PDF/A-1b) ensures that the visual appearance of a
document is preservable over the long term. Simply put, PDF/A-1b ensures that the
document will look the same when it is processed some time in the future.
>ISO 19005-1 Level A conformance (PDF/A-1a) is based on level B, but adds properties
which are known from the »Tagged PDF« flavor: it adds structure information and
reliable text semantics in order to preserve the document's logical structure and nat-
ural reading order. Simply put, PDF/A-1a not only ensures that the document will
look the same when it is processed some time in the future, but also that its contents
(semantics) can be reliably interpreted and will be accessible to physically impaired
users. PDFlib’s support for PDF/A-1a is based on the features for producing Tagged
PDF (see Section 9.6, »Tagged PDF«, page 216).
When PDF/A (without any conformance level) is mentioned below, both conformance
levels are meant.
Implementation basis. The following standards and documents form the basis for
PDFlib’s implementation of PDF/A-1:
>The PDF/A standard (ISO 19005-1:2005)
>Technical Corrigendum 1 (ISO 19005-1:2005/Cor 1:2007)
>Technical Corrigendum 2 (ISO 19005-1:2005/Cor.2:2010(E))
>All relevant TechNotes published by the PDF/A Competence Center.
PDF/A
Competence Center
53
208
Chapter 9: Generating various PDF Flavors
9.5.2 Generating PDF/A-conforming Output
Creating PDF/A-conforming output with PDFlib is achieved by the following means:
>PDFlib will automatically take care of several formal settings for PDF/A, such as PDF
version number and PDF/A conformance keys.
>The PDFlib client program must explicitly use certain function calls and options as
detailed in Table 9.9.
>The PDFlib client program must refrain from using certain function calls and option
settings as detailed in Table 9.10.
>Additional rules apply when importing pages from existing PDF/A-conforming doc-
uments (see Section 9.5.3, »Importing PDF/A Documents with PDI«, page 211).
If the PDFlib client program obeys to these rules, valid PDF/A output is guaranteed. If
PDFlib detects a violation of the PDF/A creation rules it will throw an exception which
must be handled by the application. No PDF output will be created in case of an error.
Cookbook Code samples can be found in the Cookbook topics pdf_flavors/starter_pdfa, pdf_flavors/
text_to_pdfa, and pdf_flavors/images_to_pdfa.
Required operations for PDF/A-1b. Table 9.9 lists all operations required to generate
PDF/A-conforming output. The items apply to both PDF/A conformance levels unless
otherwise noted. Not calling one of the required functions while in PDF/A mode will
trigger an exception.
Prohibited and restricted operations. Table 9.10 lists all operations which are prohibit-
ed when generating PDF/A-conforming output. The items apply to both PDF/A con-
formance levels unless otherwise noted. Calling one of the prohibited functions while
in PDF/A mode will trigger an exception. Similarly, if an imported PDF document does
not comform to the current PDF/A output level, the corresponding PDI call will fail.
Additional requirements and restrictions for PDF/A-1a. When creating PDF/A-1a, all re-
quirements for creating Tagged PDF output as discussed in Section 9.6, »Tagged PDF«,
Table 9.9 Operations which must be applied for PDF/A-1 level A and B conformance
item
PDFlib function and option requirements for PDF/A conformance
conformance level
The pdfa option in PDF_begin_document( ) must be set to the required PDF/A conformance level,
i.e. one of PDF/A-1a:2005 or PDF/A-1b:2005.
output condition
(output intent)
PDF_load_iccprofile( ) with usage=outputintent or PDF_process_pdi( ) with action=copy-
outputintent (but not both methods) must be called immediately after PDF_begin_document( )
if any of the device-dependent colors spaces Gray, RGB, or CMYK is used in the document. If an
output intent is used, an ICC profile must be embedded (unlike PDF/X, unembedded standard out-
put conditions are not sufficient in PDF/A). Use the embedprofile option of PDF_load_
iccprofile( ) to embed a profile for a standard output condition.
fonts
The embedding option of PDF_load_font( )
(and other functions which accept this option) must be
true. Note that embedding is also required for the PDF core fonts.
grayscale color
A gray, RGB, or CMYK ICC profile must be set as PDF/A output condition if grayscale color is used in
the document.
RGB color
An RGB ICC profile must be set as PDF/A output condition if RGB color is used in the document.
CMYK color
A CMYK ICC profile must be set as PDF/A output condition if CMYK color is used in the document.
74
9.5 PDF/A for Archiving 209
page 216, must be met. In addition, some operations are not allowed or restricted as de-
tailed in Table 9.11.
The user is responsible for creating suitable structure information; PDFlib does nei-
ther check nor enforce any semantic restrictions. A document which contains all of its
text in a single structure element is technically correct PDF/A-1a, but violates the goal of
faithful semantic reproduction, and therefore the spirit of PDF/A-1a.
Table 9.10 Operations which must be avoided or are restricted to achieve PDF/A conformance
item
Prohibited or restricted PDFlib functions and options for PDF/A conformance
annotations
PDF_
create_annotation( ): annotations with type=FileAttachment must be avoided; for text an-
notations the zoom and rotate options must not be set to true. The annotcolor and
interiorcolor options must only be used if an RGB output intent has been specified. The
fillcolor option must only be used if an RGB or CMYK output intent has been specified, and a
corresponding rgb or cmyk color space must be used.
form fields
PDF_
create_field( ) and
PDF_
create_fieldgroup( ) for creating form fields must be avoided.
actions and
JavaScript
PDF_
create_action( ): actions with type=Hide, Launch, Movie, ResetForm, ImportData,
JavaScript must be avoided; for type=name only NextPage, PrevPage, FirstPage, and LastPage
are allowed.
images
The OPI-1.3 and OPI-2.0 options and interpolate=true option in
PDF_
load_image( ) must be
avoided.
ICC profiles
ICC profiles loaded with PDF_load_iccprofile( ) must comply to ICC specification ICC.1:1998-09
and its addendum ICC.1A:1999-04 (internal profile version 2.x).
page sizes
There are no strict page size limits in PDF/A. However, it is recommended to keep the page size
(width and height, and all box entries) in the range 3...14400 points (508 cm) to avoid problems
with Acrobat.
templates
The OPI-1.3 and OPI-2.0 options in
PDF_
begin_template_ext( ) must be avoided.
transparency
Soft masks for images must be avoided: the masked option for
PDF_
load_image( ) must be avoid-
ed unless the mask refers to a 1-bit image.
The opacityfill and opacitystroke options for
PDF_
create_gstate( ) must be avoided unless
they have a value of 1; if blendmode is used it must be Normal.
The opacity option in
PDF_
create_annotation( ) must be avoided.
transparency groups The transparencygroup option of PDF_begin/end_page_ext( ), PDF_begin_template_ext( ), and
PDF_open_pdi_page( ) is not allowed.
security
The userpassword, masterpassword, and permissions options in
PDF_
begin_document( ) must
be avoided.
PDF version /
compatibility
PDF/A is based on PDF 1.4. Operations that require PDF 1.5 or above (such as layers) must be avoid-
ed.
PDF import (PDI)
Imported documents must conform to a PDF/A level which is compatible to the output docu-
ment, and must have been prepared according to a compatible output intent (see Table 9.13).
metadata
All predefined XMP schemas (see PDFlib Reference) can be used. In order to use other schemas
(extension schemas) the corresponding description must be embedded using the PDF/A extension
schema container schema.
51
210
Chapter 9: Generating various PDF Flavors
Output intents. The output condition defines the intended target device, which is im-
portant for consistent color rendering. Unlike PDF/X, which strictly requires an output
intent, PDF/A allows the specification of an output intent, but does not require it. An
output intent is only required if device-dependent colors are used in the document. The
output intent can be specified with an ICC profile. Output intents can be specified as
follows:
icc = p.load_iccprofile("sRGB", "usage=outputintent");
As an alternative to loading an ICC profile, the output intent can also be copied from an
imported PDF/A document using PDF_process_pdi( ) with the option action=copyoutput-
intent.
Creating PDF/A and PDF/X at the same time. A PDF/A document can at the same time
conform to PDF/X-1a:2003 or PDF/X-3:2003. In order to achieve such a combo file supply
appropriate values for the pdfa and pdfx options of PDF_begin_document( ), e.g.:
ret = p.begin_document("combo.pdf", "pdfx=PDF/X-3:2003 pdfa=PDF/A-1b:2005");
The output intent must be the same for PDF/A and PDF/X, and must be specified as an
output device ICC profile. PDF/X standard output conditions can only be used in combi-
nation with the embedprofile option.
Table 9.11 Additional requirements for PDF/A-1a conformance
item
PDFlib function and option equirements for PDF/A-1a conformance
Tagged PDF
All requirements for Tagged PDF must be met (see Section 9.6, »Tagged PDF«, page 216).
The following are strongly recommended:
>
The Lang option should be supplied in PDF_begin/end_document( ) to specify the default docu-
ment language.
>
The Lang option should be specified properly in PDF_begin_item( ) for all content items which
differ from the default document language.
>
Non-textual content items, e.g. images, should supply an alternate text description using the
Alt option of PDF_begin_item( ).
>
Non-Unicode text, e.g. logos and symbols should have appropriate replacement text specified
in the ActualText option of PDF_begin_item( ) for the enclosing content item.
>
Abbreviations and acronyms should have appropriate expansion text specified in the E option
of PDF_begin_item( ) for the enclosing content item.
annotations
PDF_create_annotation( ): a non-empty string must be supplied for the contents option
Table 9.12 Additional operations must be avoided or are restricted for PDF/A-1a conformance
item
Prohibited or restricted PDFlib functions and options or PDF/A-1a conformance
fonts
The monospace option, unicodemap=false, and autocidfont=false in PDF_load_font( ) (and
other functions which accept these options) must be avoided.
PDF import (PDI)
Imported documents must conform to a PDF/A level which is compatible to the output document
(see Table 9.13), and must have been prepared according to the same output intent.
Documents you may be interested
Documents you may be interested