Facturx.Xmp (Facturx v0.2.0)

Copy Markdown View Source

Promote a base PDF/A XMP packet into a Factur-X / ZUGFeRD one.

Given the document-level XMP of a valid PDF/A-2 (or already-A-3) file, this:

  • bumps pdfaid:part 2 → 3 (conformance level preserved);
  • declares the Factur-X extension schema in pdfaExtension:schemas (namespace urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#, prefix fx) — required so veraPDF accepts the fx:* properties;
  • adds the fx:* properties (DocumentType, DocumentFileName, Version, ConformanceLevel).

The transformation is idempotent: re-promoting an already-Factur-X XMP is a no-op for the parts that already exist.

Summary

Functions

The fx:ConformanceLevel string for a Factur-X profile.

Promote xmp for the given profile and embedded filename.

Functions

conformance_level(atom)

@spec conformance_level(Facturx.profile()) :: String.t()

The fx:ConformanceLevel string for a Factur-X profile.

promote(xmp, profile, filename \\ "factur-x.xml")

@spec promote(binary(), Facturx.profile(), String.t()) :: binary()

Promote xmp for the given profile and embedded filename.