You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PDF A-3 - embeding xml into the exported document #4411
I would like to be able to embed XML data into the output PDF following the PDF/A-3 standard. I see that A-2 support is planned and tracked in #2942. Is Typst planning to eventually also support A-3?
Use Case
I am looking into generating electronic invoices with Typst. If I understand it correctly, this will often require embedding the invoice data into the PDF, which is specified in PDF/A-3.
Reacted by MindGirl, Rolf Bremer, Gregor Gabrovšek, Rafael Villar Burke (Pachi), l0wx, Thomas Skowron, Gaspard Boursin, Frederik Schwan, Daniel García, Akshay Raj Gollahalli and 4 more
I searched for some documentation for this and found these guidelines (in German).
It looks like the file embedding makes use of PDF File Specification Dictionaries and Embedded File Streams. The Guidelines references their documentation in "[IS32001], Kap. 7.11.3" (they missed an O in ISO), which is the PDF 2.0 standard. In the PDF 1.7 standard those are Chapter 3.10.2 and 3.10.3 respectively.
It looks like it shouldn't be too hard to implement, but it would need a person to take up the work.
One would probably first have to add the functionality to pdf-writer and after that design an API for typst itself.
For everyone else interested in ZUGFeRD/XRechnung: I played around with typst-pdf and managed to embed an invoice xml file into the Typst PDF export. pdf-writer indeed already supports everything that is needed (but typst/pdf-writer#39 will simplify it a little bit).
The Validator that ZUGFeRD links to only complains about the PDF, but is able to find and validate the xml file. So the "only" thing missing for using Typst to generate valid e-invoices is PDF/A compliance.
Activity
freundTech commentedon Jun 17, 2024
I searched for some documentation for this and found these guidelines (in German).
It looks like the file embedding makes use of PDF
File Specification DictionariesandEmbedded File Streams. The Guidelines references their documentation in "[IS32001], Kap. 7.11.3" (they missed an O in ISO), which is the PDF 2.0 standard. In the PDF 1.7 standard those are Chapter 3.10.2 and 3.10.3 respectively.It looks like it shouldn't be too hard to implement, but it would need a person to take up the work.
One would probably first have to add the functionality to pdf-writer and after that design an API for typst itself.
laurmaedje commentedon Jun 21, 2024
File specifications and embedded file streams are already implemented in PDF writer.
NiklasEi commentedon Aug 20, 2024
For everyone else interested in ZUGFeRD/XRechnung: I played around with
typst-pdfand managed to embed an invoice xml file into the Typst PDF export.pdf-writerindeed already supports everything that is needed (but typst/pdf-writer#39 will simplify it a little bit).The Validator that ZUGFeRD links to only complains about the PDF, but is able to find and validate the xml file. So the "only" thing missing for using Typst to generate valid e-invoices is PDF/A compliance.