Skip to main content

pdf2zugferd

Turn an invoice PDF exported from LibreOffice, OpenOffice or MS Office into a ZUGFeRD / Factur-X (EN 16931) PDF: the original pages plus an embedded, schema-validated factur-x.xml.

The invoice data is read straight from the PDF text layer, so no OCR is needed for office-generated PDFs. Seller data and IBAN come from a config file.

Heads-up: template-based tool. This is not a generic PDF-to-e-invoice converter. It only understands one fixed German invoice layout (see Supported invoice layout) and issues invoices without VAT (Kleinunternehmer, § 19 UStG). PDFs with a different layout are rejected, not guessed. The output is provided as is, without warranty: validate it with your own validator before relying on it for legal purposes.

Install

The tool is published on PyPI as pdf2zugferd (Python >= 3.12). The package, the import name and the command are all called pdf2zugferd.

uvx pdf2zugferd --help          # run without installing
pipx install pdf2zugferd        # or: pip install pdf2zugferd

Usage

cp config.example.toml config.toml   # fill in your data
pdf2zugferd invoice.pdf -c config.toml        # -> invoice_zugferd.pdf
pdf2zugferd invoice.pdf -c config.toml -o out.pdf --xml-only --force

Without Python, download a single-file binary from the GitHub release (Linux, Windows, macOS), or run from source with uv:

uv sync
uv run pdf2zugferd invoice.pdf -c config.toml

Supported invoice layout

The parser targets one fixed template (German labels Rechnungsdatum, Rechnungsnummer, Kundennummer, a position table, Betrag … €, Zahlungsziel beträgt N Tage). Totals are cross-checked and the tool aborts instead of emitting a wrong e-invoice. Invoices are issued without VAT (Kleinunternehmer, § 19 UStG, tax category E).

Limitations

  • The output is not converted to PDF/A-3 (fonts are not re-embedded). Most receiving software only needs the embedded XML; strict PDF/A validators may complain. Export the source as PDF/A-1b from LibreOffice if you need it.
  • Scanned PDFs are rejected; run them through OCR (e.g. ocrmypdf) first.

Development

uv run ruff format . && uv run ruff check .
uv run pytest                    # unit + e2e (CLI)
uv run bandit -r src && uv run pip-audit --skip-editable

License

Apache-2.0, see LICENSE.

Metadata

Release files for pdf2zugferd 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pdf2zugferd 0.1.1
File Size Uploaded Provenance Actions
pdf2zugferd-0.1.1.tar.gz 12.2 kB With provenance Details for pdf2zugferd-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pdf2zugferd 0.1.1
File Interpreter ABI Platform Actions
pdf2zugferd-0.1.1-py3-none-any.whl Python 3 none any Details for pdf2zugferd-0.1.1-py3-none-any.whl

Total release size: 26.3 kB

Release files / pdf2zugferd-0.1.1.tar.gz

Download URL pdf2zugferd-0.1.1.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ebf13b57a777072dd853c1b4735874cf33a3bbb907c787b52737d87d9d45d972
BLAKE2b-256 checksum
How to use checksums
9622b3ab9fc4fa24e7e3ff9ee1b816d425629435374a19140c3dc1f0d50df4f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / pdf2zugferd-0.1.1-py3-none-any.whl

Download URL pdf2zugferd-0.1.1-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4f690584f5aee1a95dc962993bcf4645f87814f82720d0fa56ef144ac741461
BLAKE2b-256 checksum
How to use checksums
3275ca93d8fffa25cc88dc09806814a70ba42c510870bea474e424f4ff35a33e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for pdf2zugferd 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pdf2zugferd-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page