ZUGFeRD and XRechnung Invoices
This article explains how to embed ZUGFeRD and XRechnung invoices in PDF documents with Telerik PdfProcessing.
The feature is available starting with Q4 2025.
ZUGFeRD (acronym for Zentraler User Guide des Forums elektronische Rechnung Deutschland) is a specification for the electronic invoice format of the same name. RadPdfProcessing supports embedding ZUGFeRD invoices, including the XRechnung profile for German public-sector electronic invoicing compliance.
Creating an Embedded Electronic (ZUGFeRD) Invoice
Adding a ZUGFeRD Invoice
RadFixedDocument document = new RadFixedDocument();
using (RadFixedDocumentEditor editor = new RadFixedDocumentEditor(document))
{
editor.CharacterProperties.TrySetFont(new FontFamily("Calibri"));
editor.InsertRun("PDF/A-3B Compliant Invoice");
}
;
byte[] bytes = File.ReadAllBytes(@"zugferd-invoice.xml");
document.EmbeddedFiles.AddZugferdInvoice(bytes);
PdfFormatProvider provider = new PdfFormatProvider();
PdfExportSettings settings = new PdfExportSettings();
settings.ComplianceLevel = PdfComplianceLevel.PdfA3B;
provider.ExportSettings = settings;
using (Stream output = File.OpenWrite("exportedInvoice.pdf"))
{
provider.Export(document, output, TimeSpan.FromSeconds(10));
}
Only a single XML invoice attachment is allowed according to the ZUGFeRD standard.
To comply with the PDF/A-3B standard, all the fonts in the documents must be embedded. Avoid using Standard Fonts because they are not embedded in the document. In .NET Standard/.NET (Target OS: None) environments, fonts beyond the 14 standard ones require a FontsProvider implementation to be resolved correctly.
Removing a ZUGFeRD Invoice
if (document.EmbeddedFiles.ContainsZugferdInvoice)
{
document.EmbeddedFiles.RemoveZugferdInvoice();
}
Specifying ZUGFeRD Conformance Levels
Starting with Q4 2025, RadPdfProcessing supports specifying the ZUGFeRD (Factur-X) conformance level when exporting PDF invoices. Higher levels generally include all requirements of the lower levels and add more structured data to support automated processing and validation scenarios.
RadPdfProcessing allows you to set the ZugferdConformanceLevel when embedding the invoice. The available options are:
| Level | Description |
|---|---|
Minimum | The minimal profile providing only the essential data needed for a compliant e-invoice. Suitable for simple use cases with limited automation. |
Basic | The basic profile providing core structured data for improved interoperability and basic automated processing between trading partners. This is the default value. |
Comfort | The comfort profile with richer structured content, typically aligned with common business requirements to enable advanced automation. |
Extended | The most comprehensive profile including extended data elements to cover advanced or industry-specific scenarios beyond the comfort profile. |
XRechnung | The German CIUS (Core Invoice Usage Specification) reference profile based on EN 16931. Used for public-sector electronic invoicing in Germany. Exports with XRECHNUNG conformance metadata and embeds the invoice XML as xrechnung.xml. |
RadFixedDocument fixedDocument = new RadFixedDocument();
fixedDocument.EmbeddedFiles.AddZugferdInvoice(File.ReadAllBytes(@"zugferd-invoice.xml"), Telerik.Documents.Fixed.Model.EmbeddedFiles.ZugferdConformanceLevel.Comfort);
XRechnung Profile
XRechnung is the German electronic invoicing standard mandated for public-sector invoicing. ZUGFeRD 2.1.1 defines an XRECHNUNG profile that enables XRechnung-compliant invoice data to be embedded in a PDF/A-3 document.
When you set the conformance level to XRechnung, RadPdfProcessing automatically:
- Sets the conformance level metadata to
XRECHNUNGin the XMP metadata. - Embeds the invoice XML with the filename
xrechnung.xmlinstead of the defaultfactur-x.xml.
RadFixedDocument document = new RadFixedDocument();
byte[] invoiceXml = File.ReadAllBytes("xrechnung-invoice.xml");
document.EmbeddedFiles.AddZugferdInvoice(invoiceXml, ZugferdConformanceLevel.XRechnung);
PdfFormatProvider provider = new PdfFormatProvider();
// Export as PDF/A-3B for ZUGFeRD compliance.
provider.ExportSettings.ComplianceLevel = PdfComplianceLevel.PdfA3B;
File.WriteAllBytes("output.pdf", provider.Export(document, TimeSpan.FromSeconds(10)));
When using the
XRechnungconformance level, the embedded filename is fixed toxrechnung.xml. For all other conformance levels, the filename isfactur-x.xml.
Validating Documents
RadPdfProcessing follows the business-rule validation for ZUGFeRD and Factur-X XML published by the European Committee for Standardization: Open-source E-invoice Validator.