zugferd

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: AGPL-3.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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.

View Source
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

func EmbedXML(inputPDFPath string, xmlContent []byte, outputPDFPath string) error

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

func ExtractXML(pdf []byte) ([]byte, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL