Skip to content

Annotations drop /Subj under PDF/A-2 and PDF/A-3, which are based on PDF 1.7 #350

Closed

Description

@jakejackson1

Mpdf::Annotation() takes a subject, but under any PDF/A or PDF/X setting the annotation is written without it:

$mpdf = new \Mpdf\Mpdf(['PDFA' => true, 'PDFAauto' => true, 'PDFAversion' => '2-B']);
$mpdf->Annotation('Body', 0, 0, 'Note', 'Author', 'A subject');
$mpdf->WriteHTML('<p>x</p>');
// The /Text annotation has no /Subj

Reproduced on #330 at b69cf1d.

Cause. Writer\MetadataWriter::writeAnnotations() skips /Subj whenever PDFA or PDFX is on (src/Writer/MetadataWriter.php:737-740), with the comment "Subj is PDF 1.5 spec". That holds for PDF/A-1 (PDF 1.4) and PDF/X-1a (PDF 1.3). It does not hold for PDF/A-2 and PDF/A-3, which are based on PDF 1.7, and #330 now writes /Version /1.7 in their catalog.

Write /Subj unless the document is PDF/X-1a or PDF/A-1, and cover it with the conformance group so veraPDF confirms the 2-B/2-U output is still valid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions