Skip to content

PDF A-3 - embeding xml into the exported document #4411

Closed

Description

@NiklasEi

Description

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.

A bit more context specific to Germany(/EU):
In B2B contexts, Germany requires electronic invoices from 1.1.2025 on. This will require embedding the invoice data into the PDF. A standard developed for that is https://de.wikipedia.org/wiki/ZUGFeRD (sorry, I could only find a German resource), which requires PDF/A-3.

Activity

  1. added
    feature request
    on Jun 17, 2024
  2. freundTech commented on Jun 17, 2024

    @freundTech
    Contributor

    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.

  3. added
    pdf
    on Jun 21, 2024
  4. laurmaedje commented on Jun 21, 2024

    @laurmaedje
    Member

    File specifications and embedded file streams are already implemented in PDF writer.

  5. NiklasEi commented on Aug 20, 2024

    @NiklasEi
    SponsorContributorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestpdf

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions