Exporting a Report to ZUGFeRD PDF
Our sample projects and report templates can help you learn the basics of working with our products.ZUGFeRD embeds a structured XML invoice inside a PDF/A file, producing a document that is both human-readable and machine-processable.
Export with ZUGFeRD settings. Render the invoice, then export to PDF supplying the XML payload and compliance level:
How it works. The visual PDF and the embedded XML describe the same invoice, so the file can be read by a person and imported automatically by accounting software.
Export with ZUGFeRD settings. Render the invoice, then export to PDF supplying the XML payload and compliance level:
var report = StiReport.CreateNewReport();
report.Load("Reports\\Invoice.mrt");
report.Render();
byte[] xmlBuf = File.ReadAllBytes("Reports\\ZUGFeRD-sample.xml");
var settings = new StiPdfExportSettings
{
ZUGFeRDComplianceMode = StiPdfZUGFeRDComplianceMode.V2_1,
ZUGFeRDInvoiceData = xmlBuf,
ZUGFeRDConformanceLevel = "EN 16931"
};
report.ExportDocument(StiExportFormat.Pdf, fileStream, settings);ZUGFeRDInvoiceData— the invoice XML bytes embedded into the PDF.ZUGFeRDComplianceMode/ZUGFeRDConformanceLevel— select the ZUGFeRD version and profile (here EN 16931).
How it works. The visual PDF and the embedded XML describe the same invoice, so the file can be read by a person and imported automatically by accounting software.