PDF Generation
Creating PDF files is straightforward today. There are many PDF libraries to choose from, and a simple solution may be sufficient when your requirements are limited — at least in theory.
But what happens when your requirements change and you need features you had not originally considered? If your chosen solution does not support them, you may have to replace the entire PDF integration or, in the worst case, maintain two libraries.
This takes time and money. Choosing a PDF library is a long-term investment: PDF is a widely used document exchange format, and new requirements and applications continue to emerge.
DynaPDF supports widely used standards such as PDF/A, PDF/X, ZUGFeRD, and Factur-X, as well as all major operating systems, including Android and iOS.
With DynaPDF, you can plan ahead with confidence: the features you may need tomorrow are often already available today.
The PDF/A Extension enables the conversion of existing PDF files to PDF/A-1b, PDF/A-2b, PDF/A-2u, PDF/A-3b, PDF/A-3u, PDF/A-4, PDF/A-4e, and PDF/A-4f. It also supports the PDF/A-3 requirements of ZUGFeRD and Factur-X invoices, including PDF containers with embedded XRechnung XML data. XRechnung itself is an XML invoice format.
In addition to PDF/A conversion, the extension supports PDF normalization and optimization. It provides full access to CheckConformance() and the related functions.
The PDF/A Extension is not required for documents created entirely with DynaPDF. As long as no external PDF files or pages have been imported, CheckConformance() can be called without a PDF/A Extension license.
During conversion, PDF files are completely rebuilt and optimized. This process removes unnecessary operators and corrects errors in content streams. The resulting files can be smaller and faster to display or print. The extent of these improvements depends on the source document.
The PDF/A converter is one of DynaPDF’s most complex components. Because of the substantial development effort involved, it is licensed separately from the standard editions.
PDF/A-1 is based on PDF 1.4 and does not allow layers or transparency. DynaPDF can flatten these features during conversion, allowing most documents to be converted to PDF/A-1b.
Wherever possible, transparency flattening rasterizes only the affected areas, preserving text so that it can still be selected and copied.
PDF/A-2 and PDF/A-3 allow layers and transparency, making them suitable for converting most documents.
PDF/A-2 and PDF/A-3 are closely related. The main difference is that PDF/A-3 allows attachments in any file format. PDF/A-2 allows certain PDF/A-compliant attachments, but DynaPDF does not implement this option.
Both versions also support more annotation types than PDF/A-1.
PDF/A-4 is based on PDF 2.0 and supports many of its features. However, it introduces additional requirements for text. For example, text-showing operators must not reference the .notdef glyph, and ActualText entries must not contain Unicode code points from the Private Use Areas (PUA).
DynaPDF supports the creation of PDF containers for ZUGFeRD 1.0, 2.0, 2.1 and later versions, and Factur-X invoices. It can also embed XRechnung XML data. These standards simplify and standardize the exchange and automated processing of invoices.
Factur-X is a Franco-German hybrid invoicing standard developed in coordination with ZUGFeRD. Since ZUGFeRD 2.1, the two standards have used the same PDF container requirements. Their EN 16931 profile implements the European standard EN 16931-1.
ZUGFeRD and Factur-X combine a PDF/A-3 document with an embedded XML invoice. The PDF provides a human-readable view, while the XML contains structured data for automated processing. Both representations must describe the same invoice. XRechnung, by contrast, is an XML format and does not require a PDF container.
For DynaPDF, creating a ZUGFeRD or Factur-X invoice involves producing a PDF/A-3 document and embedding the XML invoice with the required metadata and file association. Layers and transparency are permitted. The XML attachment must use the filename required by the selected version and profile. The following filenames are case-sensitive:
The XML invoice is typically attached directly from memory using AttachFileEx(). Set FileName to the required filename. PDF/A-3 also requires the attachment to be associated with a PDF object using AssociateEmbFile(). For an invoice attachment, set DestObject to adCatalog and select the appropriate RelationShip value. This is commonly arAlternative, but the exact requirements depend on the version and profile.
Use SetPDFVersion() to select the required output format, for example ctFacturX_Comfort. DynaPDF supports the following ZUGFeRD and Factur-X profiles:
ZUGFeRD 1.0 remains supported for compatibility, but should no longer be used for new e-invoicing implementations in Germany.
XRechnung is a German implementation of EN 16931 with additional national requirements. Compliance with the ZUGFeRD EN 16931 (Comfort) profile alone does not establish compliance with XRechnung.
ZUGFeRD introduced a dedicated XRECHNUNG reference profile in version 2.1.1. XRechnung remains an XML format; embedding the XML in a PDF does not change the recipient’s submission requirements. For example, the German federal government’s invoice portals require a standalone XML file.
For e-invoicing in Germany, use ZUGFeRD 2.1 or later with a suitable profile. MINIMUM and BASIC WL do not meet the requirements; BASIC must not be confused with BASIC WL.
The required XML fields depend on the selected version and profile. The output format selected with SetPDFVersion() must match the embedded XML invoice. The XML must also satisfy the requirements of the intended recipient.
Invoices are often created from existing PDF templates. Editing a template does not guarantee that the resulting document will comply with PDF/A. The PDF/A Extension provides CheckConformance() to convert such documents to the PDF/A format required for ZUGFeRD or Factur-X.
CheckConformance() can also be used with documents created entirely from scratch to check and adjust the PDF settings. Once the generation process reliably produces compliant documents, this additional step may no longer be necessary. No PDF/A Extension license is required for this use case, provided no external PDF content has been imported. The XML invoice should be validated separately.
DynaPDF can create most PDF/X formats. The following formats are currently supported:
PDF/X has evolved considerably over the years. Early versions focused on CMYK and spot colors, while PDF/X-3:2002 introduced support for color-managed workflows using calibrated color spaces.
Color management allows the same document to be prepared for different output conditions without recreating its content. Colors defined independently of a particular output device can be converted to the required target color space during processing.
The output intent describes the intended printing condition, typically using an ICC profile. A color-managed workflow uses this information when converting colors for output. Changing the output intent alone does not convert existing device-dependent CMYK values.
Color management also enables soft proofing: the intended print output can be simulated on screen to help identify potential color issues before printing.
DynaPDF supports color management both when creating PDF files and in its rendering engine, making it easier to achieve consistent, accurate color output.
PDF/VT is based on PDF/X, with the underlying PDF/X version depending on the PDF/VT version. Compared with standard PDF/X documents, PDF/VT documents include additional metadata organized in DPart nodes.
These nodes form a hierarchy and can describe individual pages or groups of pages. They can carry information such as color assignments, processing instructions, and other production-related data.
PDF/VT provides a standardized location and structure for this metadata, keeping production information separate from page content and making it easier for printing systems to process.
PDF/UA is sometimes mistaken for a variant of PDF/A. It is a separate accessibility standard: PDF/UA-1 is defined in ISO 14289-1 and is based on PDF 1.7. UA stands for Universal Accessibility.
While PDF/A and PDF/X primarily restrict features for specific purposes, PDF/UA defines requirements for accessible document structure and content. These include semantic tags, a logical reading order, and alternative text where needed.
Creating accessible PDFs requires more care than creating standard PDFs. In addition to meeting legal or organizational requirements, accessible documents make information available to a wider audience, including people who use assistive technology.
DynaPDF provides the functionality needed to create PDF/UA-compliant documents. Use a suitable PDF/UA validation tool to check technical conformance, and review reading order, alternative text, and other aspects that require human judgment.