Documentation
¶
Index ¶
Constants ¶
const ConformanceLevelEN16931 = "EN 16931"
ConformanceLevelEN16931 is the Factur-X / ZUGFeRD profile that matches the CII XML produced by the cii package. It is written into the XMP metadata.
const FacturXFileName = "factur-x.xml"
FacturXFileName is the mandatory filename for the XML attachment in ZUGFeRD / Factur-X.
Variables ¶
This section is empty.
Functions ¶
func EmbedXML ¶
EmbedXML produces a ZUGFeRD / Factur-X PDF/A-3 by embedding the invoice XML into an existing PDF: it attaches the XML as the associated file factur-x.xml and writes the PDF/A identifier, the Factur-X document metadata, and an sRGB output intent.
The XML stays extractable as an ordinary PDF attachment, so a recipient can process either the visual PDF or the structured data.
EmbedXML adds the PDF/A-3 structure but does not repair the visual content: the input PDF must already embed its fonts and use device RGB. A PDF rendered by headless Chromium ("print to PDF") satisfies this. To confirm full conformance, validate the output with veraPDF.
func ExtractXML ¶ added in v0.5.0
ExtractXML returns the embedded e-invoice XML from a ZUGFeRD / Factur-X / XRechnung PDF. It looks for the well-known attachment names first and falls back to the only XML attachment if exactly one exists. Returns an error when the PDF carries no invoice XML — callers use that as the signal to fall back to OCR/AI extraction.
Types ¶
This section is empty.