Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve PDF/A compliance #1561

Closed
florianbepunkt opened this issue Oct 31, 2024 · 3 comments
Closed

Improve PDF/A compliance #1561

florianbepunkt opened this issue Oct 31, 2024 · 3 comments

Comments

@florianbepunkt
Copy link
Contributor

I had the need to implement Facture-x/ZUGFeRD compliant PDF for invoicing.

During this task I found two issues with PDFlib.

1. File attachments are not PDF/A3 compliant (maybe not PDF/A compliant at all).

When adding an attachment, the attachment needs an AFRelationship entry with one of the following values:

type Relationship = | 'Alternative'
      | 'Data'
      | 'Source'
      | 'Supplement'
      | 'Unspecified';

Also an AF entry in the catalog must be added.

Both points should not add issues for different subsets AFAIK, so the only harm would be an increased API surface when adding attachments (add an option to set the attachment relationship).

2. Font CIDSet generation

The CIDSet generation here

if (this.document.subset) {
breaks PDF/A3 validation (probably A2 as well). It is only needed for A1 AFAIK, so it can be omitted for other subsets, which would make the resulting PDF compliant.

I have both features implemented in a downstream repo of React-pdf (which uses a fork), but I can port those changes and draft a PR, if this is worth merging. Both points are small in scope and should be backwards compatible.

@blikblum
Copy link
Member

I have both features implemented in a downstream repo of React-pdf (which uses a fork), but I can port those changes and draft a PR, if this is worth merging. Both points are small in scope and should be backwards compatible.

Please open a PR with only these changes

@liborm85
Copy link
Collaborator

CIDSet tested with veraPDF and it is only for PDF/A1. Implemented by commit 75a8dbc.

@liborm85
Copy link
Collaborator

Attachments fixed by PR #1562

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants