Skip to content

PDF/A-4 アーカイブ

Pro — Commercial License Required
PDF/A-4準拠機能にはProパッケージが必要です。

TCPDF-Next Proは、PDF 2.0をベースとした最新のアーカイブ規格であるPDF/A-4準拠(ISO 19005-4:2020)を実装しています。

アーカイブクラス

クラス用途
PdfAManagerPDF/A-4準拠の有効化、検証、強制
PdfAVersionEnum: A4A4fA4e
XmpMetadataDublin Core、XMP Basic、PDF/A識別
OutputIntentsRGBおよびカスタム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');

次のステップ

LGPL-3.0-or-later ライセンスの下で公開されています。