PDF/A-4 アーカイブ
★ Pro — Commercial License Required
PDF/A-4準拠機能にはProパッケージが必要です。
TCPDF-Next Proは、PDF 2.0をベースとした最新のアーカイブ規格であるPDF/A-4準拠(ISO 19005-4:2020)を実装しています。
アーカイブクラス
| クラス | 用途 |
|---|---|
PdfAManager | PDF/A-4準拠の有効化、検証、強制 |
PdfAVersion | Enum: A4、A4f、A4e |
XmpMetadata | Dublin Core、XMP Basic、PDF/A識別 |
OutputIntent | sRGBおよびカスタムICCカラープロファイル |
IccProfile | バンドルされたsRGB.iccとカスタムプロファイルの読み込み |
PdfAVersion
| レベル | ユースケース | 埋め込みファイル | 3D / リッチメディア |
|---|---|---|---|
A4 | 標準アーカイブ | いいえ | いいえ |
A4f | 添付ファイル付きドキュメント | はい | いいえ |
A4e | エンジニアリングドキュメント | はい | はい |
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とIccProfile
PDF/Aには少なくとも1つのアウトプットインテントが必要です。組み込みのファクトリメソッドを使用するか、カスタムICCプロファイルを読み込みます:
php
use Yeeefang\TcpdfNext\Pro\Archive\{OutputIntent, IccProfile};
OutputIntent::srgb(); // 画面表示(最も一般的)
OutputIntent::fogra39(); // ヨーロッパのコート紙オフセット
OutputIntent::gracol2006(); // 米国商業印刷
// カスタムICCプロファイル
$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
PDF/Aが有効になると、XMPメタデータは自動的に生成されます。カスタムプロパティの追加:
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');バリデーションルール
| ルール | 要件 |
|---|---|
| アウトプットインテント | 少なくとも1つ必要 |
| フォント埋め込み | すべてのフォントを埋め込む必要がある(base-14は不可) |
| 暗号化 | 許可されない |
| JavaScript | 許可されない |
| カラースペース | デバイス非依存またはアウトプットインテントでカバーされている必要がある |
| XMPメタデータ | 存在し、一貫性がある必要がある |
強制モード
違反が発生した時点で即座にキャッチします:
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."手動バリデーション
php
$result = $manager->validate();
foreach ($result->violations() as $v) {
echo "{$v->severity()}: {$v->message()} [{$v->clause()}]\n";
}PDF/A-4と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');次のステップ
- PAdES デジタル署名 -- すべてのPAdESレベルでの署名作成。
- 長期検証 -- DSS、OCSP、CRL、およびアーカイブタイムスタンプ。
- Proパッケージ概要 -- 全モジュール一覧とライセンス情報。