Skip to content

Guide

Extract XML from a Factur-X or ZUGFeRD PDF

Find the embedded XML in a Factur-X or ZUGFeRD invoice, check its profile and compare its data with the PDF while keeping the original unchanged.

A hybrid invoice contains a readable presentation and embedded structured data. Extracting that data lets you inspect it or pass it to a compatible tool. Extraction should not rewrite the received document or replace the accounting original. Keep those purposes separate throughout the process.

Start with the original file

Use the PDF downloaded from the receiving channel. Avoid a copy made with a virtual printer: it may have lost embedded attachments. Open the file in KlarFakt’s hybrid viewer and inspect the detected information. If no invoice XML is recognised, investigate that result instead of arbitrarily renaming another attachment.

Compare both representations

Check number, date, seller, buyer, currency and totals. If the PDF shows a different amount from the XML, ask the issuer to clarify. Editing only one representation leaves the document inconsistent. Also note the declared profile, because the data present depends on the Factur-X or ZUGFeRD profile.

Check the extracted XML

Use checks matching the supported profile and read the report’s stated limits. Successful extraction certifies neither PDF/A, a signature nor overall tax compliance. Retain the original PDF, extracted XML and validation result with names allowing them to be matched. Request a new export from the issuer if the required structure is missing. Do not attach guessed data to an existing invoice just to obtain a successful detection.

Check your own case reproducibly

Work on a copy first and retain the unchanged original. Record the expected result, the action actually performed and the software version used. Afterwards, compare the document number, parties, currency and amounts with the original invoice. Investigate any difference before reusing the result. A small anonymised example is more useful for diagnosing a failure than indiscriminately sharing complete customer records. Repeat the test after changing an export setting and, where relevant, confirm that the actual business partner can receive and process the resulting document.

Sources and next steps

Tools for this topic

More guides

No legal advice. Dates and obligations follow the official publications cited in the text; where a date is not final, the text says so.

Google Analytics is optional and off by default. Privacy and cookies

Your privacy choices

These settings concern our home and reading pages. Our tools process invoices locally, without ads or audience measurement.

Optional and off by default. Measure page views to improve the site, with a browser identifier kept for up to 30 days. No invoices, searches or form input are sent. You can withdraw your consent here at any time.

Google advertising

Advertising choices are managed in Google’s consent window. They do not activate Google Analytics on their own. You can continue using the site after refusing.

Google choices will appear when its service is available in your region. You can always disable measurement here.

Read the privacy policy