Click or drag to resize

ZUGFeRD / Factur-X Electronic Invoices

ZUGFeRD (Germany) and Factur-X (France) are the same European standard for hybrid electronic invoices: a PDF/A-3 document that people read, with the invoice data embedded as XML (EN 16931, Cross Industry Invoice) that accounting software reads. Create the invoice document, add the XML with AddZugferdInvoice, and save.

Creating a ZUGFeRD / Factur-X invoice
// a ZUGFeRD invoice is a PDF/A-3 document
Document document = new Document(PdfStandardSubset.Pdf_A_3b);
document.DocumentInformation.Title = "Invoice INV-2026-0042";

// the readable invoice: here from an HTML template, rendered with the Chromium engine
PdfPage page = document.AddPage();
HtmlToPdfElement invoice = new HtmlToPdfElement(0, 0, invoiceHtml, null);
invoice.RenderingEngine = RenderingEngine.Chromium;
page.AddElement(invoice);

// the machine-readable invoice: the Factur-X / ZUGFeRD XML of the same invoice (EN 16931 profile)
document.AddZugferdInvoice("factur-x.xml", ZugferdProfile.En16931, AttachmentRelationship.Alternative);

document.Save("INV-2026-0042.pdf");
document.Close();

The XML must describe the same invoice the PDF shows; ExpertPdf embeds it and writes the metadata, it does not create or validate the XML. Generate it with your accounting or invoicing software, or with a library for the Cross Industry Invoice format.

Profiles, relationship and schema

Parameter

Values

ZugferdProfile

The profile of the XML: Minimum, BasicWL, Basic, En16931 (the full European standard, the usual choice), Extended, XRechnung (the German public sector; the embedded file is named xrechnung.xml).

AttachmentRelationship

Alternative (the XML is another form of the invoice - the usual value), Data or Source.

ZugferdSchema (optional)

FacturX10 (the default: Factur-X 1.0 / ZUGFeRD 2.1+, file factur-x.xml) or Zugferd20 (ZUGFeRD 2.0, file zugferd-invoice.xml).

The document must be PDF/A-3: Pdf_A_3b, Pdf_A_3u, or Pdf_A_3a for an invoice that is also accessible (with Tagged = true and the Chromium or Blink engine). The XML can also be given as a stream.

See Also