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.
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.
Flatten
flatten-form burns the form fields into the pages, which can then no longer be edited. Fill and flatten in one request:
PDF.flattenForm({ files }).
LibreOffice exports fillable fields by default (exportFormFields), so a converted form can go straight to set-form.
See Reference — PDF.