← 返回 Skills 市场
kiagentkronos-cell

Fill XFA PDF Forms

作者 kiagentkronos-cell · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
30
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install fill-xfa
功能描述
Fill XFA (Adobe LiveCycle) PDF forms programmatically. Use when working with .pdf files that have Form: XFA (check with pdfinfo). Standard tools like pdftk,...
使用说明 (SKILL.md)

Fill XFA PDF Forms

Fill any Adobe LiveCycle XFA form from the CLI. Solves a gap that standard PDF tools cannot address.

Why This Exists

XFA forms (Form: XFA in pdfinfo) embed data as XML inside the PDF, not as standard AcroForm fields. Tools like pdftk, pypdf, and PyPDF2 silently fail or produce empty output. This script modifies the embedded XFA XML directly.

Prerequisites

pip install pikepdf

Quick Start

SCRIPT="\x3Cskill_dir>/scripts/fill_xfa.py"

# 1) Verify the form is XFA:
pdfinfo form.pdf | grep Form  # Should show: Form: XFA

# 2) Discover field names:
python3 "$SCRIPT" fields form.pdf

# 3) Fill from JSON:
python3 "$SCRIPT" fill form.pdf -o filled.pdf -d data.json

Commands

fields — List Data Fields

python3 "$SCRIPT" fields form.pdf

Outputs sorted field names with current values and duplicate counts.

fill — Set Field Values

Three input methods — combine freely:

# Repeatable --set flags:
python3 "$SCRIPT" fill form.pdf -o out.pdf \
  --set "Eigentümer_Name=Müller" \
  --set "Eigentümer_Vorname=Anna" \
  --set "PLZ=84424"

# JSON file:
python3 "$SCRIPT" fill form.pdf -o out.pdf -d fields.json

# Stdin pipe:
printf '{"Name":"Müller","Vorname":"Anna"}' | \
  python3 "$SCRIPT" fill form.pdf -o out.pdf --stdin

JSON Data Format

{
  "Feldname": "Wert",
  "Eigentümer_Name": "Müller",
  "Datum": "2026-05-05"
}

Field names must match the XML element names in the form (discover with fields).

Duplicate Fields

Some forms reuse field names (e.g., multiple Textfeld1). Two modes:

  • Same value everywhere: --set Textfeld1=3 sets all occurrences to "3"
  • Different values per occurrence: Pass an array: {"Textfeld1": ["A", "B", "C"]} distributes values across duplicates (first field gets "A", second gets "B", etc.)

Limitations

  • Only works with XFA forms — verify first: pdfinfo form.pdf | grep Form
  • Form must not be password-protected
  • Namespace restoration preserves only the first xmlns:* declaration (rarely matters)
  • Some forms require manual wet-ink signature after filling

Common Use Cases

  • Government registration forms (German: Behördendrucke, Landkreis forms)
  • Utility company forms (waste collection, water/electricity)
  • School enrollment applications
  • Any Adobe LiveCycle Designer form downloaded from official websites

Example: German Waste Bin Registration

# Discover fields:
python3 "$SCRIPT" fields tonnenanmeldung_blank.pdf

# Fill from JSON (pipe to stdin):
python3 "$SCRIPT" fill tonnenanmeldung_blank.pdf -o tonnenanmeldung_filled.pdf --stdin \x3C\x3C'EOF'
{
  "Neuantrag": "1",
  "Eigentümer_Name": "Müller",
  "Eigentümer_Vorname": "Anna",
  "Eigentümer_Straße": "Hauptstraße",
  "Eigentümer_Straße_Nummer": "5",
  "Eigentümer_PLZ": "84424",
  "Eigentümer_Ort": "Isen",
  "Eigentümer_seit": "2026-01-15",
  "Grundstück_Straße": "Beispielweg",
  "Grundstück_PLZ": "85435",
  "Grundstück_Ort": "Erding",
  "Grundstück_Haus_Nummer": "12",
  "Textfeld1": "3",
  "Restmüll_ab": "07/2026",
  "Zugang_80_l": "1",
  "Bio_Zugang_80_l": "1",
  "Papier_Zugang_240_l": "1",
  "Kontoinhaber_Name": "Müller, Anna",
  "Kontoinhaber_Straße": "Hauptstraße 5",
  "Kontoinhaber_Ort": "84424 Isen",
  "Kontoinhaber_Kreditinstitut": "VR-Bank",
  "Kontoinhaber_IBAN": "DE",
  "Kontoinhaber_IBAN_Nummer": "1234567890",
  "Kontoinhaber_BIC": "GENODEF1XXX",
  "Datum": "2026-05-05"
}
EOF
安全使用建议
Before installing, review the script, install pikepdf in a trusted virtual environment, and use the tool only with PDFs and form data you are comfortable processing in the current session. Check the output PDF before submitting it, and remember that filled field values may appear in logs or transcripts.
功能分析
Type: OpenClaw Skill Name: fill-xfa Version: 1.0.0 The skill provides a specialized utility for filling Adobe XFA (LiveCycle) PDF forms by directly manipulating the embedded XML data using the pikepdf library. The Python script (scripts/fill_xfa.py) implements field discovery and data injection without any network activity, suspicious file access, or command execution. The instructions in SKILL.md are strictly aligned with the stated purpose and do not contain any prompt-injection attempts or malicious directives.
能力评估
Purpose & Capability
The stated purpose and visible code align: it inspects and fills XFA PDF XML. Because the documented examples include personal and banking form fields, users should treat inputs and command output as sensitive.
Instruction Scope
The instructions are explicit user-invoked CLI workflows for listing fields and filling PDFs; no prompt override, hidden goal redirection, or autonomous background action is shown.
Install Mechanism
The skill asks users to manually install pikepdf with pip, and no automatic install script or remote execution step is shown.
Credentials
Reading local PDFs and JSON/stdin data and writing a specified output PDF is proportionate to the purpose, but the script also prints filled values to stdout.
Persistence & Privilege
The provided artifacts show no credentials, network endpoints, persistence, elevated privileges, or background agents.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install fill-xfa
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /fill-xfa 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release — generic XFA (Adobe LiveCycle) form filler. Discovers fields, fills via --set/-d/--stdin, handles duplicates with array values. Hyperion-reviewed code + docs.
元数据
Slug fill-xfa
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Fill XFA PDF Forms 是什么?

Fill XFA (Adobe LiveCycle) PDF forms programmatically. Use when working with .pdf files that have Form: XFA (check with pdfinfo). Standard tools like pdftk,... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 30 次。

如何安装 Fill XFA PDF Forms?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install fill-xfa」即可一键安装,无需额外配置。

Fill XFA PDF Forms 是免费的吗?

是的,Fill XFA PDF Forms 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Fill XFA PDF Forms 支持哪些平台?

Fill XFA PDF Forms 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Fill XFA PDF Forms?

由 kiagentkronos-cell(@kiagentkronos-cell)开发并维护,当前版本 v1.0.0。

💬 留言讨论