Skip to main content
All docs
V23.2

How to: Create a ZUGFeRD-Compliant PDF Invoice

The code sample below shows how to attach a ZUGFeRD-compliant XML to the PDF document and save the result:

using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor())
{
    pdfDocumentProcessor.LoadDocument("Invoice.pdf");
    pdfDocumentProcessor.Document.AttachZugferdInvoice
        (File.ReadAllBytes("ZUGFeRD-invoice.xml"));
    pdfDocumentProcessor.SaveDocument("Invoice_Upd.pdf");
}

Note

The AttachZugferdInvoice method does not convert the document to a PDF/A-3b compatible file. Make sure that your document is PDF/A-3b compliant.