今日已更新 98 条资讯 | 累计 29551 条内容
关于我们

A PDF a Human Reads and a Machine Parses at the Same Time: How PDF4me Builds ZUGFeRD E-Invoices

PDF4me 2026年08月03日 17:37 4 次阅读 来源:Dev.to

Picture the scenario: your invoicing pipeline generates a clean, branded PDF for a German B2B customer. It looks right. It would print fine, email fine, and satisfy anyone who opens it by hand. Then it bounces, because since January 1, 2025, that customer is legally required to receive invoices in a format their software can parse without a human retyping the totals. A pretty PDF isn't enough anymore, and honestly, for a machine, it never really was the point. The part that surprises people who haven't dealt with this yet: the mandate doesn't force you to give up the human-readable PDF. It just requires that PDF to carry a second, structured version of itself, riding along inside it. That format is called ZUGFeRD, with an internationally aligned sibling called Factur-X. If you've never had to build one, it's worth understanding the mechanics before the code, because it's a genuinely clever piece of engineering, not just a compliance checkbox. So how does a single file manage to be both a human-readable invoice and a machine-parseable one at once? What a ZUGFeRD invoice actually is Open a ZUGFeRD invoice in Adobe Acrobat or any PDF viewer and you see a normal invoice: logo, line items, totals, payment terms, nothing unusual. But embedded inside that same file, in its attachments, sits an XML document carrying the exact same invoice data in structured, typed form: invoice number, line items, tax rates, totals, every field an accounting system needs, tagged rather than buried in a paragraph a parser has to guess at. The container format making this possible is PDF/A-3 , the only PDF/A variant that permits arbitrary file attachments while still meeting the archival standard's long-term readability requirements. PDF/A-1 and PDF/A-2 explicitly forbid embedded attachments; PDF/A-3 was built for exactly this use case, which is why every ZUGFeRD file you'll open is, underneath, a PDF/A-3b document with an XML file riding inside it. The embedded XML follows EN 16931, the EU's

本文内容来源于互联网,版权归原作者所有
查看原文