PDF/A Conformance

Introduction

The PDF/A specifications ISO 19005-1 through 19005-4 define restrictions on the PDF format to enable its use as archival format. Many governments, libraries, news papers, etc. need such a format to permanently store PDF documents.

The benefit of using PDF/A for this is that it restricts the use of certain PDF functionality which would make the PDF file dependent on external resources or special viewers. For example, all fonts have to be embedded and multimedia/Javascript content is forbidden.

While PDF/A-1 is based on PDF 1.4, PDF/A-2 and PDF/A-3 are based on PDF 1.7. The newest iteration PDF/A-4 is based on PDF 2.0.

Each PDF/A specification comes with a set of conformance levels to which a PDF file may conform:

PDF/A-1
The first iteration of PDF/A supports the levels ‘B’ (basic conformance) and ‘A’ (accessible conformance). Level ‘A’ is a superset of ‘B’ and requires PDF files to be tagged.
PDF/A-2
The second iteration of PDF/A supports the same conformance levels as PDF/A-1. Additionally, it adds the level ‘U’ which is between ‘A’ and ‘B’ and requires that all text has Unicode mappings available.
PDF/A-3
This is the same as PDF/A-2 but allows embedding any kind of file (whereas PDF/A-2 only allows embedding PDF/A conforming files).
PDF/A-4
This specification differs a bit from the former because it abandons the ‘B’, ‘U’ and ‘A’ conformance levels. A file may be conforming to PDF/A-4 or to the new conformance levels ‘F’ (PDF/A-4 with embedded files) or ‘E’ (PDF/A-4 for engineering).

HexaPDF supports the creation of PDF files conforming to the levels 2b, 2u, 3b, and 3u. Once tagged PDF is implemented, HexaPDF will eventually support levels 2a and 3a.

Creating a PDF/A Conforming Document

Though HexaPDF supports the creation of PDF/A files, the author needs to make sure they don’t use anything that is forbidden in them.

To tell HexaPDF that a document should be conforming to PDF/A, the :pdfa task needs to be invoked, with the optional level argument specifying the conformance level:

document.task(:pdfa, level: '3b')

The task ensures, among other things, that the basic additions to a standard PDF to make it PDF/A compatible are done.

Here is a partial list of requirements that need to be followed:

To ensure that a document created with HexaPDF is PDF/A compliant, a PDF/A validation tool like veraPDF can be used.

An PDF/A file created by HexaPDF that follows these rules is available as an example.

Best Practices