Native Linux ABI form appearances

hpdf_document_execute_json_v1 fills loaded AcroForm fields through forms.fill, generating matching normal appearances by default and retaining the original PDF revisions, passwords, security dictionary and document IDs

{"schemaVersion":1,"type":"forms.fill","fields":[
  {"name":"Notes","value":"First line Ω\nSecond café","fontSize":13},
  {"name":"Combo","value":"two"},
  {"name":"Colors","values":["blue","red"]},
  {"name":"Check","checked":true},
  {"name":"Radio","checked":true,"onState":"B"},
  {"name":"Submit","caption":"Send Ω"}
]}

Field values and appearances

Text fields accept value or typed richTextRuns; a supplied value alongside richTextRuns must match the derived plain text exactly, including CR paragraph separators

Plain appearances respect inherited multiline, comb, alignment and rotation settings and embed the selected Unicode TrueType font; styled runs carry explicit font style, size, color, alignment, paragraph breaks and decorations

Password text fields mask their appearances and glyph mappings with one bullet per Unicode scalar while retaining the actual stored field value and original encryption; file-select fields display their literal Unicode path without opening the selected file

Choice fields accept one value string or a complete values array, never both; export values map to option display text, multiple selections are sorted by option index, and an empty array clears the selection

Checkboxes and radio groups require Boolean checked; onState defaults to Yes and selects the matching radio widget when explicitly supplied, while clearing updates both field and widget states

Push buttons require caption, which is painted with the selected embedded Unicode font

forms.read includes the complete values array for every choice field, including an empty array after clearing; the scalar value member remains available

For rich fields, forms.read also returns the stored XHTML richText string; ordinary value replacements synchronize RV, and styled runs require appearance generation

Options and publication

Each edit accepts fontFamily (default DejaVu Sans), fontSize (12), padding (2), characterSpacing (0), wordSpacing (0) and paintWhiteBackground (true)

Typed rich edits may also use fontFamilies arrays and per-run family selection, retaining the original single-family behavior when the array is absent

Text edits may explicitly set appearance:false for value-only updates; choice and button edits require appearance generation

Unknown fields, duplicate edits, invalid selections, excessive comb values, malformed parameters, cancellation, resource exhaustion and failed callbacks leave the current loaded document unchanged; output is prepared before any binary publication callback runs

The operation result contains updated and the current field list; discover supported appearance types through the formAppearances capability array

Native C ABI acceptance generates actual plaintext and AES R5/R6 form outputs; independent pypdf and MuPDF checks inspect selection indices, widget states, embedded fonts, Unicode values, encryption and actual appearance pixels

Native Linux C ABI · Signing workflows · Remaining delivery plan