PDF Generation

Creating PDF files is no longer a challange...

PDF Generation

Creating PDF files is no longer a challenge these days. The range of PDF libraries is large and as long as no special requirements have to be met, simple solutions are sufficient, at least in theory.

But what happens when the requirements change and features are suddenly needed that nobody initially thought of? If the supposedly "simple" solution doesn’t support it, you can start to integrate the entire PDF functionality again or, in the worst case, use two libraries.

Not only is that annoying, it also costs a lot of time and money. A PDF solution should therefore be viewed as a long-term investment, because PDF is the standard exchange format par excellence, and new solution options arise quickly.

DynaPDF not only supports all common standards like PDF/A, PDF/X, ZUGFeRD or Factur-X, it also supports all common operating systems, including mobile versions such as Android and iOS.

With DynaPDF you can look relaxed into the future, as most features are already available.

PDF/A

The PDF/A Extension enables the conversion of arbitrary PDF files to PDF/A 1b, 2b, 2u, 3b, 3u, 4, 4e, 4f, as well as ZUGFeRD, Factur-X and XRechnung (ZUGFeRD, Factur-X and XRechnung are invoice formats based on PDF/A 3).

In addition to standard PDF/A conversion, PDF files can also be normalized and optimized. The PDF/A extension enables full use of CheckConformance() and its associated additional functions.

The PDF/A extension is not required for documents created entirely with DynaPDF. That means that as long as no external PDF file or individual PDF pages have been imported, CheckConformance() can be executed even without a licensed PDF/A extension.

PDF/A files are completely rebuilt and optimized during conversion. This also removes unnecessary operators and errors in content streams. The resulting files are smaller and can be displayed or printed faster. The impact of the optimization depends on the quality of the source material.

The PDF/A converter is one of the most complex features in DynaPDF. Due to the significant development effort involved, this feature unfortunately cannot be included in the regular licenses.

PDF/A 1a, 1b

PDF/A 1b based on PDF 1.4. Therefore, this format is more limited since important features like layers or transparency are prohibited. Layers can be flattened during conversion but this is not possible with transparent objects. Such pages could possibly be rasterized, but it would be much better to switch to PDF/A 2 or 3, since transparency is allowed here.

PDF/A 2a, 2b, 2u, 3a, 3b, 3u

Since layers and transparency are allowed in PDF/A 2 and 3, most documents can be converted to these formats.

PDF/A 2 and 3 are almost identical. The only difference is that arbitrary file attachments are allowed in PDF/A 3. PDF/A compliant file attachments are supported in PDF/A 2 but this rule is not implemented in DynaPDF since there is no real usecase.

In comparison to PDF/A 1 many more annotation types are supported.

PDF/A 4, 4e, 4f

PDF/A 4 based on PDF 2.0 and most features can be used. However, the text handling is again slightly more restricted in comparison to prior versions. All references to the .notdef glyph are prohibited and no Unicode code point can lie inside the Private Usage Area (PUA).

ZUGFeRD, XRechnung, Factur-X

With DynaPDF, invoices can also be generated in the invoice formats ZUGFeRD 1.0, 2.0, 2.1 (or higher), Factur-X, and XRechnung. ZUGFeRD and XRechnung are German invoice formats which are intended to simplify and standardize the exchange of invoices between companies and authorities.

Factur-X is a French invoice standard that reflects the requirements of the European standard EN 16931-1. Factur-X and ZUGFeRD beginning with version 2.1 (EN 16931-1) are identically defined in regard to the PDF container.

ZUGFeRD, XRechnung or Factur-X files consist of a PDF/A 3 file and an XML invoice that is attached to the PDF file. The PDF file represents the visual representation of the invoice, while the XML file is intended for electronic processing. The XML and PDF files have a precisely defined structure, making electronic processing very easy.

From DynaPDF’s point of view, a ZUGFeRD, XRechung or Factur-X file is a PDF/A 3 file that contains an XML file as attachment. Since layers and transparency are not prohibited, the creation is relatively unproblematic. There is not much to consider, except when attaching the XML file. The XML file must be named as follows (case sensitive!):

  • ZUGFeRD 1.0:"ZUGFeRD-invoice.xml"
  • ZUGFeRD 2.0:"zugferd-invoice.xml"
  • ZUGFeRD 2.1:"factur-x.xml"
  • Factur-X:"factur-x.xml"

The XML file is mostly attached directly from memory with AttachFileEx(). The parameter FileName must be set to the correct value. In PDF/A 3, attachments must also be associated to a PDF object with AssociateEmbFile(). The parameter DestObject must be set to adCatalog and RelationShip to arAlternative (the rules in Factur-X files are slightly different).

Last but not least, the PDF version has to be set to the desired output version with SetPDFVersion(), e.g. to ctFacturX_Comfort, finished! DynaPDF supports all ZUGFeRD and Factur-X profiles:

ZUGFeRD 1.0:

  • Basic
  • Comfort
  • Extended

Although ZUGFeRD 1.0 is still supported, such files should no longer be created. These formats are not valid e-invoice formats.

XRechnung:

There is another invoice standard in Germany, the German XRechnung. The ZUGFeRD 2.0 profile Comfort (EN 16931-1) fullfills the requirements of the XRechnung.

XRechnung was a pure XML format in its original defintion, but was extended for e-invoice and has been included in ZUGFeRD 2.1 as a new profile.

ZUGFeRD 2.x / Factur-X:

  • Minimum
  • Basic
  • Basic WL
  • Comfort (EN 16931)
  • Extended

Note that the profiles Minimum, Basic, and Basic WL are not valid e-invoice formats!

Depending on the version used, the XML invoice contains more or less required fields. The ZUGFeRD, XRechnung or Factur-X profile is part of the PDF version and must therefore match the XML invoice.

Invoices are very often created from templates and whenever an existing file is edited, it is not sure whether the result will be PDF/A compliant too. For this purpose the function CheckConformance() of the PDF/A extension can be used to convert regular PDF files to these invoice formats.

CheckConformance() can also be called for completely new created files. In this way, the correct settings can be found or checked quickly. When everything is correct, CheckConformance() no longer needs to be called. It is also important to know that the PDF/A Extension is not required for this usecase.

PDF/X

Mit DynaPDF können die meisten PDF/X Formate erzeugt werden. Unterstützt werden derzeit folgende Formate:

  • PDF/X-1a:2001(ISO 15930-1)
  • PDF/X-3:2002(ISO 15930-3)
  • PDF/X-1a:2003(ISO 15930-4)
  • PDF/X-3:2003(ISO 15930-6)
  • PDF/X-4(ISO 15930-7)
  • PDF/X-4p(ISO 15930-7)
  • PDF/X-5g(ISO 15930-8)
  • PDF/X-5n(ISO 15930-8)
  • PDF/X-5pg(ISO 15930-8)
  • PDF/X-6(ISO 15930-9)
  • PDF/X-6n(ISO 15930-9)
  • PDF/X-6p(ISO 15930-9)

PDF/X has been significantly extended in recent years. While the first versions processed uncalibrated CMYK data only, the use of calibrated colors was introduced with PDF/X-3:2002.

Processing calibrated colors means that color management is used. The advantage over pure CMYK data is that the same PDF file can be converted into different target color spaces without having to rebuild the PDF file.

Only the so-called output intent needs to be changed, which is nothing more than the target color space in form of an ICC color profile. The conversion to the target color space happens fully automatically if color management is supported.

An additional feature of color management is its ability to simulate different target color spaces. Potential problem areas can therefore be identified already on screen.

DynaPDF supports color management not only when creating PDF files, but also in the rendering engine. Color-accurate rendering is therefore incredibly easy.

PDF/VT-1, PDF/VT-2, PDF/VT-3

PDF/VT files based on PDF/X-4 or higher, depending on the PDF/VT version. Compared to standard PDF/X documents, PDF/VT documents contain additional metadata in form of so-called DPart nodes.

These are hierarchically structured metadata that can contain additional information about individual pages or groups of pages. This could include, for example, color assignments, processing steps, or any other production relevant data.

PDF/VT offers a precisely defined storage location for additional metadata that is not part of the print data. This was often a problem before PDF/VT, as such a defined storage location did not exist.

PDF/UA

PDF/UA is often mistakenly considered as another sub-format of PDF/A. In fact, PDF/UA is a separate format (ISO 32000-1 or ISO 14289-1) that has far more in common with the regular PDF format than with PDF/A. The abbreviation UA stands for Universal Accessibility.

While formats like PDF/A or PDF/X restrict the use of certain features, PDF/UA defines which tagging information needs to be added for a PDF file to comply with accessibility guidelines.

Creating accessible PDF files is more complex compared to creating standard PDF files. Therefore, this format is primarily used by government agencies and organizations that are legally required to do so.

DynaPDF can easily generate valid PDF/UA files. However, it is also recommended to use a PDF/UA-compatible preflight tool to ensure the correct settings are found.

Easy and reliable
Expand your possibilities
Everything you need for e-invoicing
PDF formats for printing...
PDF/X plus metadata for printing
The accessibility PDF format