docling-project / docling-project/docling
Support extraction of filled AcroForm field values from interactive PDFs
- Dominant language
- Python
- Stars
- 66.4k
- Forks
- 4.8k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 98
Description
### Description
Docling currently parses the template structure of interactive PDF forms (AcroForm) but ignores filled field values. Processed PDFs appear as blank forms even when the AcroForm dictionary contains user-entered data. This limits Docling for workflows involving completed government/legal forms.
### Current Behavior
- ✅ Field labels and layout extracted
- ✅ Form structure (lines/boxes/tables) detected
- ❌ Filled text field values missing
- ❌ Checkbox / radio selection states missing
- ❌ Output shows only underscores or empty placeholders
Docling's output does not reflect submitted form data.
### Expected Behavior
Expose actual AcroForm field values:
- Text fields → extracted string values
- Checkboxes → checked/unchecked
- Radio buttons → selected option
- Dropdowns → selected entry
Ideally surfaced in a structured section (e.g., \`form_fields\`) alongside text/blocks/tables.
### Technical Details
- Tested PDF: ~110 AcroForm fields, ~74 filled text fields, several \`/Btn\` (checkbox/radio); \`/AcroForm\` present in catalog.
- Using pypdf, values are accessible:
\`\`\`python
from pypdf import PdfReader
reader = PdfReader("filled.pdf")
fields = reader.get_form_text_fields()
# {'surname': 'Smith', 'firstname': 'Jane', 'email': 'jane@example.com', ...}
\`\`\`
- Docling output shows only the static form template.
### Use Case
Automated extraction/validation of completed administrative or legal forms where the layout matters (Docling's strength) and the entered data is essential (immigration forms, tax forms, insurance claims, government applications). Lack of AcroForm value extraction is a blocker.
### Comparison
Other tools (vision OCR) can capture values visually but introduce OCR noise, lose semantic field identifiers, and are slower. Docling could combine the best of both by reading AcroForm dictionaries directly.
### Related
- #673 (about visual extraction of form-filled regions; different layer). This issue targets native AcroForm value extraction.
### Proposed Solution
Add native parsing of /AcroForm:
- Merge /Fields values into structured output
- Include text, checkbox, radio, dropdown values
- Preserve field names and bounding boxes (if available)
- Expose as a \`form_fields\` JSON section parallel to text blocks/tables
This avoids OCR and accurately reflects user-submitted data.
Contributor guide
Assessment
This issue has not been assessed yet.