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

Fix ZugferdPdfWriter not outputting metadata if there are no files #100

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

danielmarschall
Copy link
Contributor

@danielmarschall danielmarschall commented Jul 9, 2024

Background information

A customer requires to receive only a single XML with a PDF embedded as base64.
This task was easy to manage using addDocumentAdditionalReferencedDocument().

I wanted to avoid having a XML containing a PDF which itself contains an XML (Matrjoschka), so I just did a XML containing a PDF.

Although not required, I thought that it would be a nice touch if the embedded PDF was PDF/A-3B instead of a plain PDF. So, I wrote a method based on ZugferdPdfWriter, which converts a plain PDF to PDF/A-3B (without attachments).

The bug

ZugferdPdfWriter has the problem that it does not write any metadata information if no files are included.
This PR fixes the issue.

While it does not affect the "normal usage" of this library, it fixes a problem where other people developing/extending the library might stumble upon.

@horstoeko horstoeko merged commit 272e9ba into horstoeko:master Jul 10, 2024
6 checks passed
Repository owner locked as resolved and limited conversation to collaborators Jul 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants