Skip to content

PDF/A in .NET

PDF/A (ISO 19005) is the archival form of PDF: a document that displays exactly the same in decades, on any system, because it depends on nothing outside itself. Its fonts are embedded, its colours are defined by an ICC profile, its metadata is in a standard XML form (XMP), and anything that could change or break, such as JavaScript, encryption or external content, is forbidden. Invoices, statements, contracts, records kept for legal retention and documents sent to public bodies are often required to be PDF/A.

Profile Based on Use it for
pdf-a-2b PDF 1.7 Most archival documents.
pdf-a-3b PDF 1.7 Documents with attached files of any kind, such as the XML of a Factur-X invoice.
pdf-a-4 PDF 2.0 Archival documents as PDF 2.0; combines with PDF/UA-2.
pdf-a-4f PDF 2.0 PDF 2.0 documents with attached files.

The “b” profiles guarantee that the document looks right (“basic”). Combined with pdf-ua-1 or pdf-ua-2, it is also accessible.

This letter is PDF/A-2b and passes veraPDF. Download the PDF.

archival-letter.report.yaml
# An archival letter (PDF/A-2b): fonts embedded, colours defined, metadata in XMP, so it displays the same in decades.
title: "Your contract, renewed"
language: en-IE
culture: en-IE
document:
author: Contoso Ltd
subject: Contract renewal
compliance: [pdf-a-2b]
page: { size: A4, margins: 25mm }
fonts:
Inter: { regular: fonts/Inter-Regular.ttf, bold: fonts/Inter-Bold.ttf }
styles:
default: { font: Inter, fontSize: 10.5pt, lineHeight: 1.5 }
parameters:
Recipient: { type: string, default: "='Dr Aoife Ó Súilleabháin'" }
Renewed: { type: date, default: "=Date(2026, 9, 24)" }
body:
reportHeader:
- gap: 14pt
content:
- { type: text, value: "Contoso Ltd · 12 Quay Street · Galway", fontSize: 8.5pt, color: "#6F6459" }
- { type: text, value: "{Recipient}\n12 Quay Street\nGalway H91 E2PX" }
- { type: text, value: "{Renewed:D}", align: end }
- { type: text, value: "Your contract, renewed", fontSize: 14pt, fontWeight: bold, tag: h1 }
- type: text
align: justify
value: >-
Dear {Recipient}, thank you for another year with us. Your support contract now runs until
{AddYears(Renewed, 1):D}, on the same terms. We keep this letter as PDF/A, the archival form of PDF: its
fonts are embedded and its colours defined, so it will look exactly like this whenever it is opened.
- { type: text, value: "Kind regards,\nContoso Ltd" }
The rendered letter: sender, recipient, date, a heading, a justified paragraph, and a closing.

compliance: [pdf-a-2b] is all it takes, with fonts to embed. Tagua then:

  • embeds and subsets every font, with a map back to the text (so the text can be searched and copied);
  • adds an sRGB output intent, the ICC profile that defines what the colours mean;
  • writes the title, author and subject as XMP metadata, consistent with the document information;
  • checks the template first: PDF/A forbids the standard fonts that are not embedded (a template without fonts), PDF/A-2 forbids attachments that are not PDF, and PDF/A-4 allows attachments only as pdf-a-4f.

PDF/A-3 and PDF/A-4f can carry files inside the PDF, such as the data a document was made from. Tagua’s account statement sample is PDF/A-4f and PDF/UA-2 at once, with its transactions attached as CSV:

document:
compliance: [pdf-a-4f, pdf-ua-2]
attachments:
- name: transactions.csv
source: "{Csv}" # a parameter or field: the file's text or bytes
mimeType: text/csv
relationship: data
description: The statement's transactions as comma-separated values

Download the statement and open the attachments panel of your PDF viewer.

veraPDF is the reference validator for PDF/A, free and open source:

Terminal window
verapdf -f 2b archival-letter.pdf # or 3b, 4, 4f