Hi,
I tried to create a ZUGFeRD PDF and attach the corresponding XML.
I used your code template from docs here: Attach ZUGFeRD
What didn’t work for me was setting the correct MIMEType
. Like in the template, I set the MIMEType
to text/xml
but when I checked the embedded files in the saved pdf, the Xml was added with the MIMEType
application/pdf
.
After a quick search I found this old post: MIMEtype is not set when adding an XML attachment to PDF
It is declared as a bug there but no solution was provided.
Since there was no solution I tried some things and noticed that when you convert the pdf to the PDF A3U format first and then add the embedded files, the correct MIMEType
will be set.
I don’t know if this is still a bug or if the docs are outdated.