This example demonstrates how to export a simple report to a PDF/A-3b (ISO 19005-3) file that conforms to the ZUGFeRD specification used for electronic invoices in Germany.
Files to Review
Documentation
- Export to PDF
- Create a Report with a Visual PDF Signature
- Create an Invoice
- Create an Invoice from Templates
- Create a Swiss QR Bill
More Examples
- How to Export a Report to PDF and Specify Export Options
- How to use the digital signature options when exporting a report to PDF
- How to Create a Custom DevExpress Report Control
- Reporting for WinForms - How to Use MailKit to Send a Report as a Document in PDF
Does this example address your development requirements/objectives?
(you will be redirected to DevExpress.com to submit your response)
Example Code
C#using System;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
using DevExpress.XtraPrinting;
namespace ZUGFeRD_sample {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e) {
var report = new XtraReport1();
report.XmlDataPath = "ZUGFeRD-rechnung.xml";
string additionalMetadata =
File.ReadAllText("ZUGFeRD_DocumentInfo.txt") +
File.ReadAllText("ZUGFeRD_PdfASchema.txt");
PdfExportOptions options = new PdfExportOptions() {
PdfACompatibility = PdfACompatibility.PdfA3b,
AdditionalMetadata = additionalMetadata
};
options.Attachments.Add(new PdfAttachment() {
FilePath = "ZUGFeRD-rechnung.xml",
Type = "text/xml",
Description = "Rechnungsdaten im ZUGFeRD-XML-Format",
});
report.ExportToPdf("result.pdf", options);
Process.Start("result.pdf");
}
}
}