Free Support Forum - aspose.com

ZUGFeRD sample code

Hi all,
As AsposePDF now supports the ZUGFeRD PdfFormat selector, is there sample code available on building one PDF up (the official way) to be used as ZUGFeRD document?
It had been available with the 20.11 release notes, but I cannot find it any more.
Thanks, regards
Jörg Fischer

@JFischerComneos

Please check the below code snippet to create ZUGFeRD PDF Format using Aspose.PDF:

Document doc = new Document();
doc.Pages.Add();
string fileName = "zugferd-invoice.xml";
FileSpecification fs = new FileSpecification(fileName);
doc.EmbeddedFiles.Add(fs);
fs.Description = "Zugferd";
doc.Convert(new MemoryStream(), PdfFormat.ZUGFeRD, ConvertErrorAction.Delete);
doc.Save("invoice.pdf");