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
| Class | Purpose |
|---|---|
PdfAManager | Enables, validates, and enforces PDF/A-4 compliance |
PdfAVersion | Enum: A4, A4f, A4e |
XmpMetadata | Dublin Core, XMP Basic, PDF/A identification |
OutputIntent | sRGB and custom ICC color profiles |
IccProfile | Bundled sRGB.icc and custom profile loading |
PdfAVersion
| Level | Use Case | Embedded Files | 3D / Rich Media |
|---|---|---|---|
A4 | Standard archival | No | No |
A4f | Documents with attachments | Yes | No |
A4e | Engineering documents | Yes | Yes |
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
| Rule | Requirement |
|---|---|
| Output intent | At least one required |
| Font embedding | All fonts must be embedded (no base-14) |
| Encryption | Not permitted |
| JavaScript | Not permitted |
| Color space | Device-independent or covered by output intent |
| XMP metadata | Must 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
- PAdES Digital Signatures -- Signature creation at all PAdES levels.
- Long-Term Validation -- DSS, OCSP, CRL, and archival timestamps.
- Pro Package Overview -- Full module listing and license information.