Long-term archiving · PHP
Create PDF/A in PHP
Generate archival-grade PDF/A from PHP with one method call. rust-pdf embeds the sRGB ICC profile, adds the output intent, writes the XMP metadata and document ID, and enforces the rules, so the output validates under veraPDF, the reference validator.
Last updated: 2026-06-29
Why PHP needs this
PDF/A is mandated for e-invoicing, court filings and public-sector archives precisely because it forbids anything that could render differently in ten years: external fonts, unmanaged colour, encryption. Most PHP PDF stacks cannot produce a conformant file at all.
rust-pdf embeds and subsets every font, attaches the sRGB ICC profile and an output intent, writes XMP metadata kept in sync with the document info, and enforces the rest of the rule set. It covers A-1b through A-3a and the PDF 2.0-based A-4 family, and veraPDF, the open-source reference validator, confirms conformance.
A Symfony console command or scheduled task is the obvious place to batch archival exports; everything runs in-process, so you retire the wkhtmltopdf or TCPDF pipeline and its install footprint. composer require and ext-ffi are the only prerequisites, and the absence of a license raises a catchable PdfException.
- Levels A-1b, A-2b, A-2a, A-3b, A-3a and A-4 (the PDF 2.0 part), with the accessible a-levels building a full tagged structure tree.
- Fonts embedded and subset automatically, ICC profile and output intent added for you.
- XMP metadata kept in sync with the document info, validated by veraPDF.
Create PDF/A in PHP with rust-pdf
Add the package with Composer, then call the same idiomatic API every binding shares. The PDF/A snippet below is real PHP from the reference docs.
composer require rust-pdf/rustpdf
use RustPdf\{Document, PdfaLevel};
$doc = new Document();
$doc->pdfa(PdfaLevel::A2b)->setInfo(title: 'Q3 Report', author: 'Acme Inc.');
$f = $doc->addFontFile('Roboto-Regular.ttf');
$doc->addPage()
->showText($f, 20, 72, 760, 'Archival report')
->save('report_pdfa.pdf'); // throws PdfException without a PDF/A license
Generation in PHP is free; PDF/A is a corporate feature enabled by one offline license token. See pricing & licensing.
The complete PDF/A API is in the PHP documentation.
PDF/A in PHP: FAQ
Which PDF/A levels are supported in PHP?
rust-pdf creates PDF/A-1b, 2b, 2a, 3b, 3a and 4 (the PDF 2.0-based part, including 4e and 4f). Use a basic b-level for visual fidelity, an a-level for an accessible tagged structure, or a 3-level when you need to embed source files such as an e-invoice XML.
How is conformance verified?
Output is validated with veraPDF, the open-source reference validator for PDF/A, plus qpdf and mutool for structure. The claim is backed by validators, not adjectives.
Do I need a license to create PDF/A in PHP?
PDF/A is a corporate feature and requires an active license token. Basic generation in PHP is free. One offline token unlocks PDF/A in every supported language.
Can I turn an HTML invoice into PDF/A in a Symfony command?
rust-pdf does not render HTML; you build the page with the Document API and call pdfa(), which is exactly what keeps the output deterministic and veraPDF-valid. A Symfony console command or scheduled task is the natural home for archival batch jobs, and the library embeds the fonts itself, so there is no wkhtmltopdf to install or sandbox.
Make your PHP documents last for decades
One Rust core, the same archival output in every language. Build and validate PDF/A locally, and activate a license token when conformant files ship.