Function EN Version 10.10

@PDFExtractInvoiceXML

PDF

Syntax

@PDFExtractInvoiceXML(PDF);

Description

Extracts the invoice XML embedded in a ZUGFeRD/Factur-X PDF file.
The PDF data is processed directly from a BINBUFFER. No temporary file in the file system is required.
The function searches the PDF document for an embedded invoice XML file and returns its contents as a new BINBUFFER.
The returned buffer can, for example, be processed directly with @XMLParse.
The function does not perform any business-level or schema validation of the invoice data. It only extracts the XML file embedded in the PDF.

BINBUFFER PDF:
BINBUFFER containing the complete contents of the PDF file.

Return value:
On successful processing, a BINBUFFER containing the embedded invoice XML is returned.
If no suitable invoice XML can be found or the PDF cannot be processed, an error is returned.
The returned BINBUFFER must be released with @DestroyBuffer after processing.

Example: @PDFExtractInvoiceXML(PDF);

PDFBuffer:=@CreateBuffer(PDFLength);

/* Read PDF data into PDFBuffer … */

XMLBuffer:=@PDFExtractInvoiceXML(PDFBuffer);
IF(!@IsError(XMLBuffer)){
XMLDoc:=@XMLParse(XMLBuffer;1);

/* Process invoice XML … */

@XMLRelease(XMLDoc);
XMLBuffer:=@DestroyBuffer(XMLBuffer);
}
PDFBuffer:=@DestroyBuffer(PDFBuffer);

Extracts the embedded ZUGFeRD/Factur-X invoice XML from a PDF provided as a BINBUFFER.

Note : This text was machine-translated and may contain inaccuracies.