Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Create a ZUGFeRD-Compliant PDF Invoice

The PdfDocument.AttachZugferdInvoice method allows you to attach a ZUGFeRD-compliant XML to the PDF document. PDF Document API fully supports ZuGFeRD e-invoicing standard (including ZuGFeRD v2.3.2).

The following code sample attaches an invoice and saves 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

Consider the following when you attach a ZUGFeRD-compliant XML:

  • The PdfDocumentProcessor does not validate the attached invoice.
  • 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.