PDF Standards: PDF/A, PDF/X |
By default the converter generates standard PDF documents that every PDF reader opens. With the PdfStandardSubset property it generates documents that conform to an ISO subset of PDF - for long term archiving (PDF/A), for printing (PDF/X) or for electronic invoices (PDF/A-3). Accessibility (PDF/UA) is a separate standard, declared with its own property and combined with an archiving level; see Tagged PDF.
PdfStandardSubset | Standard | Use |
|---|---|---|
Full | The default: every PDF feature can be used. | |
Pdf_A_1b | PDF/A-1b (ISO 19005-1) | Long term archiving, for systems that require PDF/A-1. No transparency: translucent content is painted opaque. |
Pdf_A_1a | PDF/A-1a | PDF/A-1b with a tagged, accessible structure. The PDF/A-1 level that combines with PDF/UA-1. |
Pdf_A_2b | PDF/A-2b (ISO 19005-2) | Long term archiving; transparency and layers allowed. The usual choice for archiving. |
Pdf_A_2u | PDF/A-2u | PDF/A-2b with Unicode text that can be reliably extracted and searched. |
Pdf_A_2a | PDF/A-2a | PDF/A-2u with a tagged, accessible structure. |
Pdf_A_3b | PDF/A-3b (ISO 19005-3) | PDF/A-2b that can embed files of any type (associated files): electronic invoices, source data. |
Pdf_A_3u | PDF/A-3u | PDF/A-3b with Unicode text that can be reliably extracted and searched. |
Pdf_A_3a | PDF/A-3a | PDF/A-3u with a tagged, accessible structure. |
Pdf_A_4 | PDF/A-4 (ISO 19005-4) | Long term archiving on PDF 2.0. The archiving level that combines with PDF/UA-2. |
Pdf_A_4e | PDF/A-4e | The engineering variant of PDF/A-4 (embedded 3D and rich media). |
Pdf_A_4f | PDF/A-4f | The variant of PDF/A-4 that allows embedded files of any kind. |
Pdf_X_1a | PDF/X-1a:2001 (ISO 15930-1) | Graphics exchange for printing: CMYK colors, no transparency. |
A PDF/A document embeds all its fonts and carries the metadata that identifies it as PDF/A. The Chromium engine embeds every font a page uses, so a converted page needs no preparation. The level A subsets (Pdf_A_1a, Pdf_A_2a, Pdf_A_3a) need the tagged structure of the document: the converter turns tagging on by itself when one of them is set. A PDF/A-4 document carries no document information dictionary, as the standard requires; the title and the other properties are written in its XMP metadata.
A PDF/X-1a document is written with CMYK colors: the converter converts the colors of the rendered page, its images and its gradients, and paints translucent content opaque, since the standard allows neither RGB colors nor transparency.
PDF/A and PDF/X documents cannot be encrypted: the standards forbid it, so do not set a password in PdfSecurityOptions for them.
Archiving and accessibility are separate ISO standards that combine: set the archiving level with PdfStandardSubset and the accessibility standard with AccessibilityStandard. Each PDF/UA part is defined on a version of PDF, which decides the archiving levels it combines with:
PDF/UA-1 (PDF 1.7) combines with PDF/A-1a, the PDF/A-2 and PDF/A-3 levels and PDF/X-1a. With PDF/A-1 use Pdf_A_1a: PDF/A-1b cannot carry the structure PDF/UA needs.
PDF/UA-2 (PDF 2.0) combines with PDF/A-4, PDF/A-4e and PDF/A-4f.
A combination that cannot be produced, such as PDF/UA-2 with PDF/A-3 or PDF/UA-1 with PDF/A-4, is refused with an exception rather than written as a document that conforms to neither.
PdfConverter converter = new PdfConverter(); // archived and accessible: PDF/A-4 with PDF/UA-2 converter.PdfStandardSubset = PdfStandardSubset.Pdf_A_4; converter.AccessibilityStandard = PdfUAStandard.Pdf_UA_2; // an accessible document needs a title and a language converter.PdfDocumentInfo.Title = "Annual report"; converter.Language = "en-US"; converter.SavePdfFromUrlToFile("https://www.example.com/report", "report.pdf");
A PDF/A-3 document can carry other files - the data behind a report, the source document, an XML invoice. Convert to a Document object, add the files with AddAssociatedFile, then save. The AttachmentRelationship says how the file relates to the document (Source, Data, Alternative, Supplement).
PdfConverter converter = new PdfConverter(); converter.PdfStandardSubset = PdfStandardSubset.Pdf_A_3b; using (Document document = converter.GetPdfDocumentObjectFromUrl( "https://www.example.com/sales-report")) { // the data the report was made from, embedded as an associated file document.AddAssociatedFile("sales.csv", AttachmentRelationship.Data, "text/csv", "Sales figures"); document.Save("sales-report.pdf"); }
For electronic invoices, use AddZugferdInvoice, which also writes the invoice metadata the standards require.
A document built in code takes its level from the Document(PdfStandardSubset) constructor. An existing PDF document loaded into a Document is converted with ConvertToPdfA(PdfStandardSubset) to one of the PDF/A-1, PDF/A-2 or PDF/A-3 levels (a level A needs a document that is already tagged). A PDF/A document only takes appended documents that conform to its level; see Merge Capabilities.