/
PDF doesn't support X-Rechnung

PDF doesn't support X-Rechnung

KB-20250221-01

Version

Before XFRX 24.3

Symptoms

  • Calls CreateZUGFeRDMetadata() method do not create right metadata for X-Rechnung. 

Cause

  • CreateZUGFeRDMetadata() method create internal name zugferd-invoice.xml for version 2.1.

Workaround

LOCAL m.lnErr, m.loFile, m.loSession 
m.loSession=EVALUATE([xfrx("XFRX#INIT")])
m.lnErr=m.loSession.SetParams("some.pdf",,,,.T.,,"PDF")
m.loSession.setpdfa(.T., "3B")
IF m.lnErr=0
   * Relation type must be "Alternative" 
   m.loFile=m.loSession.addAttachment("some-x-rechnung.xml", .T., "Rechnungsdaten im XRechnung-XML-Format", "text/xml", "Alternative")
   m.loFile.CreateZUGFeRDMetadata("BASIC", "INVOICE", "2.1") && if you use PDFA 

   m.loFile.cShortFileName="xrechnung.xml" && Sets right file name in PDF

   m.loSession.ProcessReport("report.frx")
ENDIF