Skip to content

PDF/A-4 Archival

Pro — Commercial License Required
PDF/A-4 compliance features require the Pro package.

TCPDF-Next Pro implements PDF/A-4 conformance (ISO 19005-4:2020), the latest archival standard based on PDF 2.0.

Archive Classes

ClassPurpose
PdfAManagerEnables, validates, and enforces PDF/A-4 compliance
PdfAVersionEnum: A4, A4f, A4e
XmpMetadataDublin Core, XMP Basic, PDF/A identification
OutputIntentsRGB and custom ICC color profiles
IccProfileBundled sRGB.icc and custom profile loading

PdfAVersion

LevelUse CaseEmbedded Files3D / Rich Media
A4Standard archivalNoNo
A4fDocuments with attachmentsYesNo
A4eEngineering documentsYesYes

Enabling PDF/A-4

php
use Yeeefang\TcpdfNext\Core\Document;
use Yeeefang\TcpdfNext\Pro\Archive\{PdfAManager, PdfAVersion, OutputIntent};

$pdf = Document::create()
    ->metadata(title: 'Annual Report 2026', author: 'Finance')
    ->addPage()
    ->font('NotoSans', size: 12)
    ->text('PDF/A-4 compliant document.');

PdfAManager::enable($pdf, PdfAVersion::A4)
    ->outputIntent(OutputIntent::srgb());

$pdf->save('/archive/report.pdf');

OutputIntent and IccProfile

PDF/A requires at least one output intent. Use built-in factory methods or load custom ICC profiles:

php
use Yeeefang\TcpdfNext\Pro\Archive\{OutputIntent, IccProfile};

OutputIntent::srgb();       // screen display (most common)
OutputIntent::fogra39();    // European coated offset
OutputIntent::gracol2006(); // US commercial printing

// Custom ICC profile
$custom = new OutputIntent(
    subtype: 'GTS_PDFA1', outputConditionIdentifier: 'Custom_CMYK',
    info: 'Internal press profile', registryName: 'https://printing.example.com/profiles',
    iccProfile: IccProfile::load('/profiles/custom.icc')->bytes(),
);

XmpMetadata

XMP metadata is generated automatically when PDF/A is enabled. Add custom properties:

php
$xmp = $pdf->xmpMetadata();
$xmp->set('dc:rights', 'Copyright 2026 Acme Corporation');
$xmp->registerNamespace('acme', 'https://acme.example.com/xmp/1.0/');
$xmp->set('acme:DocumentId', 'DOC-2026-0042');

Validation Rules

RuleRequirement
Output intentAt least one required
Font embeddingAll fonts must be embedded (no base-14)
EncryptionNot permitted
JavaScriptNot permitted
Color spaceDevice-independent or covered by output intent
XMP metadataMust be present and consistent

Enforcement Mode

Catch violations immediately as they occur:

php
$manager = PdfAManager::enable($pdf, PdfAVersion::A4);
$manager->enforce(true);

$pdf->javascript(trigger: 'open', script: 'app.alert("Hello");');
// -> PdfAException: "PDF/A-4 violation: JavaScript actions are not permitted."

Manual Validation

php
$result = $manager->validate();
foreach ($result->violations() as $v) {
    echo "{$v->severity()}: {$v->message()} [{$v->clause()}]\n";
}

Combining PDF/A-4 with PAdES B-LTA

php
use Yeeefang\TcpdfNext\Pro\Security\Signature\{DigitalSigner, CertificateInfo};
use Yeeefang\TcpdfNext\Pro\Security\Timestamp\TsaClient;
use Yeeefang\TcpdfNext\Contracts\Enums\SignatureLevel;

PdfAManager::enable($pdf, PdfAVersion::A4)
    ->outputIntent(OutputIntent::srgb());

$signer = new DigitalSigner(
    CertificateInfo::fromPkcs12('/certs/archive.p12', 'pw')
);
$signer->level(SignatureLevel::PAdES_B_LTA);
$signer->timestampAuthority(new TsaClient('https://tsa.example.com/timestamp'));

$signer->sign($pdf);
$pdf->save('/archive/signed-archival.pdf');

Next Steps

Released under the LGPL-3.0-or-later License.