Skip to main content

List the fields

PDF.form() lists a form’s fields, with the values each takes, in the shape set-form fills. Pass pages to keep the fields on some pages only.
Each field has its fully qualified name, its type (text, checkbox, radio, button, combo, list or signature), its value, and the pages it sits on. states lists what a checkbox or radio group takes besides Off, and options what a choice field takes. readOnly, required, multiSelect, editable and maxLength show when they apply. A PDF without a form answers [].

Fill

set-form fills fields by their fully qualified names: a string, or an array of strings for a list that selects several.
A name the PDF doesn’t have is refused with a 400.

Flatten

flatten-form burns the form fields into the pages, which can then no longer be edited. Fill and flatten in one request:
Or flatten on its own with PDF.flattenForm({ files }). LibreOffice exports fillable fields by default (exportFormFields), so a converted form can go straight to set-form. See Reference — PDF.