📄

Fill PDF Forms

Tự động điền thông tin vào PDF forms từ data Excel/CSV.

PDF ⭐⭐ Intermediate ⏱️ 10 phút

🎯 Vấn đề cần giải quyết

Có 100 form PDF giống nhau cần điền cho 100 khách hàng? Form đăng ký cần điền hàng loạt? Hợp đồng template với thông tin khác nhau?

Pain points:

  • Điền từng form rất chậm
  • Dễ sai sót khi điền nhiều
  • Copy-paste tên/địa chỉ nhàm chán

⚖️ So sánh: Trước và Sau

Tiêu chíThủ côngAgentic Workflow
Thời gian/form5-10 phút5 giây
ErrorsThường xảy ra0
Scale10 forms/giờ1000+/giờ

💡 Prompt mẫu

Điền PDF forms tự động:

INPUT:
- PDF form template: [file]
- Data source: Excel/CSV với columns:
  - name, address, phone, email, date, ...

FIELD MAPPING:
- "Full Name" field → name column
- "Address" field → address column
- "Date" field → current date
- "Signature" → [image file]

OUTPUT:
- One PDF per row
- Naming: form_{name}.pdf
- Flatten form: Có (không edit được)

🏗️ Phase 2: Architect (Permanent Tool)

For Admin/HR Ops.

Engineering Prompt:

**Role:** Python GUI Developer (PyQt6 Specialist)
**Task:** Create "Bulk Form Filler" Desktop App

**Objective:** A batch automation tool to merge Excel data into fillable PDF templates.

**Tech Stack:**
* Language: Python 3.10+
* GUI Library: PyQt6 (Cross-platform)
* PDF Engine: pdfrw / pypdf
* Packaging: PyInstaller

**Functional Requirements:**
1.  **UI Layout (PyQt6):**
    *   **Template:** Select PDF Form.
    *   **Data:** Select Excel/CSV.
    *   **Mapper:** Grid UI to map "Excel Header" -> "PDF Field Name".
    *   **Options:** Checkbox "Flatten Result" (Read-only).
    *   **Action:** "Generate Batch".

2.  **Core Logic:**
    *   Parse PDF annotations to find field keys.
    *   Dictionary string replacement.
    *   Handle UTF-8 font embedding for non-ASCII characters.
    *   **Threading:** File IO in background thread.

3.  **Deliverables:**
    *   `main.py`: Complete source code.
    *   `requirements.txt`: Dependencies.
    *   **Build Instructions:**
        *   Windows: `pyinstaller --onefile --noconsole main.py`
        *   macOS: `pyinstaller --windowed --noconsole main.py`

🔧 Tips & Best Practices

Form types

TypeFill method
AcroFormNative support
XFA formLimited support
Static PDFOverlay text

Data preparation

  • Clean data trước (trim spaces)
  • Standardize date formats
  • Validate phone/email
  • Check field length limits

Advanced features

  • Digital signature insertion
  • Checkbox/radio button
  • Dropdown selection
  • Date picker

Độ khó: ⭐⭐ Intermediate | Thời gian: 10 phút

Related Workflows

Explore other categories

📬

Get Started with Agentic Working

Subscribe to receive updates from AgenticWorking.io

📖 Free eBook Guide 📦 7 Ready-to-use Scripts 🔔 Weekly Tips

No spam, unsubscribe anytime. Join 1,000+ subscribers.