Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/bpampuch/pdfmake/llms.txt

Use this file to discover all available pages before exploring further.

PDF/A is a family of ISO standards that define a subset of the PDF format suitable for long-term archiving. The key requirement is self-containment: everything needed to reproduce the document identically — fonts, color profiles, metadata — must be embedded inside the file. External references, encryption, and certain interactive features are forbidden. pdfmake supports all major PDF/A conformance levels through a handful of document-definition properties.

Why PDF/A Matters

Government agencies, legal firms, libraries, and any organisation with document-retention requirements often mandate PDF/A. Submitting a standard PDF to such systems may fail validation checks or be rejected outright. When pdfmake produces a PDF/A document, it embeds the required XMP metadata stream, declares the conformance level, and ensures fonts are fully embedded — satisfying the core archival requirements.

Supported Conformance Levels

pdfmake supports the following subset values:
ValueStandardAccessibility
'PDF/A-1'ISO 19005-1
'PDF/A-1a'ISO 19005-1Tagged (accessible)
'PDF/A-1b'ISO 19005-1Basic
'PDF/A-2'ISO 19005-2
'PDF/A-2a'ISO 19005-2Tagged (accessible)
'PDF/A-2b'ISO 19005-2Basic
'PDF/A-3'ISO 19005-3
'PDF/A-3a'ISO 19005-3Tagged (accessible)
'PDF/A-3b'ISO 19005-3Basic
'PDF/UA'ISO 14289-1Tagged (universal accessibility)
PDF/A-2 and PDF/A-3 are built on PDF 1.7 and allow features such as JPEG 2000 images and optional content groups. PDF/A-3 additionally permits embedding of arbitrary file attachments (see File Attachments). The 'a' conformance levels require the document to be tagged (accessible), while 'b' levels only require correct visual reproduction.

Minimal PDF/A Document

Setting the subset property in your document definition is the primary switch. You should also set the version to match the underlying PDF version required by the chosen standard, and provide info.title (required for valid XMP metadata).
const docDefinition = {
  version: '1.5',          // PDF version — 1.4 for PDF/A-1, 1.7 for PDF/A-2 and -3
  subset: 'PDF/A-3a',      // target conformance level
  tagged: true,            // mark document as Tagged PDF (required for 'a' levels)
  displayTitle: true,      // display the document title in the viewer window title bar
  info: {
    title: 'Awesome PDF document from pdfmake'
  },
  content: [
    'PDF/A document for archive'
  ]
};
This example is taken directly from examples/pdfa.js in the pdfmake source.

Document Metadata (info)

The info property populates the PDF document information dictionary and the XMP metadata stream. Valid XMP metadata is mandatory for PDF/A compliance. Provide as much information as is applicable:
title
string
required
The document title. Required for PDF/A compliance and displayed in the viewer when displayTitle: true.
author
string
The name of the document author.
subject
string
A brief description of the document subject.
keywords
string
A space- or comma-separated list of keywords.
creator
string
The name of the application that created the original content (as opposed to the PDF converter).
const docDefinition = {
  version: '1.5',
  subset: 'PDF/A-2b',
  info: {
    title: 'Annual Report 2024',
    author: 'Finance Team',
    subject: 'Full-year financial results',
    keywords: 'finance, report, 2024',
    creator: 'Accounting Suite v3.0'
  },
  content: ['Annual report content...']
};

Font Embedding Requirements

PDF/A mandates that all fonts are fully embedded in the file. pdfmake embeds fonts by default, so as long as you use fonts that are registered in the VFS, this requirement is satisfied automatically.
Do not use PDF standard fonts (Helvetica, Times, Courier, etc.) in PDF/A documents. Standard fonts are not embedded — viewers rely on local system copies, which violates the self-containment requirement. Always register and use fonts with full VFS entries.
If you are using the default Roboto font from pdfmake/build/vfs_fonts, font embedding is handled for you. For custom fonts, follow the Fonts guide to ensure they are loaded into the VFS before calling createPdf.

Tagged PDF

The tagged: true property marks the document as a Tagged PDF, which adds logical structure (tags) to the content so that screen readers and other assistive technology can navigate it. This is required for the 'a' conformance levels (PDF/A-1a, PDF/A-2a, PDF/A-3a) and for PDF/UA.
const docDefinition = {
  version: '1.5',
  subset: 'PDF/A-2a',  // 'a' level — requires tagged: true
  tagged: true,
  info: { title: 'Accessible Report' },
  content: ['Accessible content here']
};

File Attachments (PDF/A-3)

PDF/A-3 is unique in that it allows arbitrary file attachments to be embedded in the archive package. This is used, for example, to embed a machine-readable XML invoice alongside the human-readable PDF — a common requirement in electronic invoicing standards (ZUGFeRD, Factur-X). Attachments are defined in the top-level attachments dictionary and referenced by name from inline attachment nodes in the content:
const docDefinition = {
  version: '1.7',
  subset: 'PDF/A-3b',
  info: { title: 'Invoice 2024-0042' },
  content: [
    'Please find the machine-readable invoice attached.',
    {
      attachment: 'invoice-xml'
    }
  ],
  attachments: {
    'invoice-xml': {
      src: 'invoices/2024-0042.xml',  // local file path (Node.js) or data URL
      name: 'invoice-2024-0042.xml'
    }
  }
};
You can also define an attachment inline (without the attachments dictionary) by providing an object directly:
{
  attachment: {
    src: 'data:application/xml;base64,...',
    name: 'invoice.xml',
    description: 'Machine-readable invoice data (ZUGFeRD)'
  }
}
File attachments are only permitted in PDF/A-3. Using the attachments key with subset: 'PDF/A-1' or subset: 'PDF/A-2' will produce a non-conformant document.

displayTitle

When displayTitle: true is set, PDF viewers show the document’s info.title in the window title bar instead of the filename. This is good practice for archival documents where the filename may change over time.
const docDefinition = {
  version: '1.5',
  subset: 'PDF/A-3a',
  tagged: true,
  displayTitle: true,
  info: { title: 'Contract 2024-Legal-0099' },
  content: ['Contract text...']
};

Known Limitations and Gotchas

No encryption

PDF/A documents must not be encrypted. Setting userPassword or ownerPassword together with subset will produce a non-conformant file. The archival standard requires that the file can always be opened without a password.

No standard fonts

Helvetica, Times-Roman, Courier, and other 14 standard PDF fonts are not embedded. Using them in a PDF/A document violates the self-containment requirement. Use VFS-registered fonts only.

ICC profile dependency

A valid PDF/A document must declare an output intent with an embedded ICC color profile. pdfmake handles this internally, but if you are post-processing the PDF with external tools, ensure they preserve the output intent.

External references forbidden

Any content that references an external URL (remote images, remote fonts) is not permitted in PDF/A. All resources must be embedded. Use data URLs or local files for images, and register fonts via the VFS.
After generating a PDF/A document, validate it with a dedicated tool such as veraPDF (open source, available at verapdf.org) to confirm conformance before submitting to archival systems.

Build docs developers (and LLMs) love