XFA
XML Forms Architecture
A legacy Adobe XML-based form technology in PDF that supports dynamic layouts and rich form logic, deprecated in PDF 2.0.
Техническая деталь
PDF XFAs use the AcroForm or XFA specification to define widgets that capture user input. AcroForm fields support text, checkboxes, radio buttons, dropdowns, and signature fields with built-in JavaScript validation. Each field stores its value separately from the visual appearance, allowing programmatic extraction and pre-filling. XFA (XML Forms Architecture) offers more dynamic layouts but is deprecated in PDF 2.0 in favor of AcroForm.
Пример
```javascript
// Fill PDF form fields
const form = pdf.getForm();
form.getTextField('name').setText('Jane Doe');
form.getCheckBox('agree').check();
form.getDropdown('country').select('United States');
// Flatten form (make fields non-editable)
form.flatten();
```