Ef Ge
Ef Ge

Reputation: 818

Create PDF/a-3 invoices

I am using tcpdf to generate invoices in the pdf/a1-b format. As far as I know is there no possibility to generate pdf-a3 with tcpdf. Is there any possibility to convert pdf/a-1b to pdf/a-3? Is it just generating an invoice.xml file and append it to my invoice.pdf?

Upvotes: 2

Views: 7375

Answers (2)

HaWei
HaWei

Reputation: 51

The library mPDF now supports the creation of files that are PDF/A-3 compliant. https://mpdf.github.io/ You can find more information at: https://mpdf.github.io/what-else-can-i-do/pdf-a3-xmp-rdf.html#

Furthermore I found this library to generate the required XML file: https://github.com/easybill/zugferd-php However, that's probably not the latest standard ZUGFeRD 2.1 from March 2020. More information on the Standard can be found at: https://www.ferd-net.de/zugferd/zugferd-2.1/index.html

Upvotes: 3

Bruno Lowagie
Bruno Lowagie

Reputation: 77528

Take a look at my slides ZUGFeRD: an overview and you'll notice that you can't just use any invoice.xml. Although a PDF/A-1b file also conforms to PDF/A-3b, you can't just append the XML file as an attachment.

You need to name the XML file ZUGFeRD-invoice.xml (not invoice.xml) and add this XML as an associated file (/AF) to the defining the relationship as Alternative. You also need to tell the PDF which level of ZUGFeRD you're conforming to (basic, comfort, extended). This is done in the XMP stream (the same place where you define a file as PDF/A-3).

I am not aware of any PHP libraries that is advanced enough to achieve this. The concept of associated files is rather new, and ZUGFeRD was only introduced in 2014 in Germany. The English translation of the spec dates from January 2015. It would surprise me if the popular PHP libraries for PDF already know about ZUGFeRD.

Upvotes: 2

Related Questions