← 返回
开发者工具 中文

ZUGFeRD Invoice Merger

Merge ZUGFeRD 2.1 compliant invoice PDF and time report into a single visible multi-page PDF/A-3b file with embedded XML for German B2B/Gov use.
将符合 ZUGFeRD 2.1 标准的发票 PDF 与工时报告合并为一个可见的多页 PDF/A-3b 文件,并嵌入 XML,用于德国 B2B/政府采购。
quantx-heiko
开发者工具 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 675
下载
💾 10
安装
1
版本
#e-invoicing#european#germany#invoice#latest#pdf#xml#zugferd

概述

zugferd-invoice

Create ZUGFeRD 2.1 / Factur-X compliant e-invoices with visible merged pages. German B2B / Gov-ready.

🇩🇪 Germany/EU only - This skill implements the German ZUGFeRD standard for electronic invoicing.

Features

  • Visible pages: Merge invoice + time report into a single multi-page PDF
  • ZUGFeRD 2.1 compliant: PDF/A-3b with embedded XML
  • EN16931 valid: Ready for B2B portals and government submission
  • No paid APIs: Uses MustangProject (open source) + GhostScript
  • Two workflows: Visible pages (recommended) or attachment-only fallback

Requirements

DependencyInstallNotes
----------------------------
Java 11+brew install openjdk@21Required by MustangProject
GhostScriptbrew install ghostscriptPDF/A-3 conversion
mustang.jarManual downloadZUGFeRD processor

Install mustang.jar

mkdir -p ~/.openclaw/tools/mustang
curl -L https://github.com/ZUGFeRD/mustangproject/releases/download/core-2.22.0/mustang.jar \
     -o ~/.openclaw/tools/mustang/mustang.jar

Usage

Recommended: GhostScript Workflow (Visible Pages)

export PATH="/opt/homebrew/opt/openjdk@21/bin:$PATH"
cd ~/.openclaw/workspace/skills/zugferd-invoice

python3 scripts/zugferd_pages_workflow.py \
  --invoice Rechnung.pdf \
  --attachment Zeitnachweis.pdf \
  --output Rechnung_komplett.pdf

Output:

  • Multi-page PDF (both documents visible)
  • PDF/A-3b compliant
  • ZUGFeRD 2.1 XML embedded
  • Valid for B2B/Gov portals

Fallback: Attachment-Only Workflow

python3 scripts/zugferd_workflow.py \
  --invoice Rechnung.pdf \
  --attachment Zeitnachweis.pdf \
  --output Rechnung_komplett.pdf

Output:

  • Invoice visible, time report as file attachment
  • Use when GhostScript is unavailable

Arguments

FlagDescriptionRequired
-----------------------------
--invoiceOriginal ZUGFeRD e-invoice PDF✅ Yes
--attachmentTime report / additional document✅ Yes
--outputOutput path for merged PDF✅ Yes
--keep-tempKeep temporary files (debug)❌ No

Workflows Compared

FeatureGhostScript (Recommended)Attachment-Only (Fallback)
----------------------------------------------------------------
Visible pages✅ Both documents⚠️ Only invoice
Time report visibility✅ Page 2+❌ File attachment only
PDF/A-3 compliance✅ Full✅ Full
Requires GhostScript✅ Yes❌ No
ComplexityMediumLow

Technical Details

GhostScript Workflow Steps

  1. Extract XML from original e-invoice
  2. Merge PDFs with GhostScript (visible pages)
  3. Convert to PDF/A-3 with GhostScript
  4. Embed XML with MustangProject combine
  5. Validate final PDF

Why This Works

Standard PDF merging breaks PDF/A-3 compliance. The trick:

  1. Merge first (any PDFs allowed)
  2. Then convert the merged result to PDF/A-3
  3. Finally embed the ZUGFeRD XML

This preserves visible pages while achieving full compliance.

Why Attachment-Only?

If your time report cannot be converted to PDF/A (e.g., Lexware exports with broken ICC profiles), use --attachments flag which embeds files without visible merging.

Troubleshooting

"gs not found"

brew install ghostscript

"java not found"

brew install openjdk@21
export PATH="/opt/homebrew/opt/openjdk@21/bin:$PATH"

"mustang.jar not found"

Download from MustangProject releases

Validation fails

  • Ensure input invoice is valid ZUGFeRD PDF/A-3
  • Check GhostScript version: gs --version (should be 10+)

Output Verification

# Check PDF/A compliance
java -jar ~/.openclaw/tools/mustang/mustang.jar --action validate \
  --source Rechnung_komplett.pdf

# Should output: <summary status="valid"/>

Notes

  • ZUGFeRD = Germany only: Electronic invoicing standard for German B2B
  • Factur-X: French equivalent (also supported)
  • EN16931: European standard for e-invoices
  • Source PDFs: Invoice must be ZUGFeRD PDF/A-3; attachment can be any PDF

Dependencies

  • Python 3.8+
  • Java 11+ (MustangProject)
  • GhostScript 10+
  • MustangProject CLI 2.22.0+

See Also

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 07:45 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 920 📥 185,726
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 65 📥 179,837
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 666 📥 323,786