Skip to content

Support creating PDFs conforming to PDF/A-1a, PDF/A-2a and PDF/A-3a #2574

Description

@malte-laukoetter

Weasyprint currently does not support creating files conforming to the a-conformance-levels of PDF/A. This conformance level indicates that the files are additionally to the requirements of the u-variant (or b-variant for PDF/A-1) also is accessible. Weasyprint already supports creating PDF/UA-1 conforming (and therefore accessible) files.

Could you add support for the a-conformance-levels as well?

In my testing I was able to create PDF/A-2a conforming files by choosing PDF/A-2u and also using the --pdf-tags flag to create an accessible pdf file. The only PDF/A-2a rule the file was then not conforming to was that the conformance-level is not indicated in the metadata (https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Parts-2-and-3-rules#rule-664-3) By manually overwriting the metadata afterwards I was able to create a PDF/A-2a conforming file.

Therefore the following addition to pdfa.py should be enough to fix this:

'pdf/a-1a': (
    partial(pdfa, version=1, variant='A'),
    {'version': '1.4', 'identifier': True, 'srgb': True, 'pdf_tags': True}),
'pdf/a-2a': (
    partial(pdfa, version=2, variant='A'),
    {'version': '1.7', 'identifier': True, 'srgb': True, 'pdf_tags': True}),
'pdf/a-3a': (
    partial(pdfa, version=3, variant='A'),
    {'version': '1.7', 'identifier': True, 'srgb': True, 'pdf_tags': True}),

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature that should be supported

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions