Skip to contents

Polymorphic setter: the semantics depend on the field's type.

Usage

pdf_form_field_set_value(field, value)

Arguments

field

A pdfium_form_field from pdf_form_fields(). Parent doc must be readwrite.

value

Character scalar OR logical scalar (for checkable types). See type-specific rules above.

Value

Invisibly returns the parent pdfium_doc.

Details

  • Text ("textfield", "xfa_textfield"): value must be a character scalar. Sets /V directly.

  • Checkbox / radio ("checkbox", "radiobutton", "xfa_checkbox"): value may be either a logical scalar or a character scalar. TRUE writes the field's on-state name (inferred from the current /V or /AS, falling back to "Yes"); FALSE writes "Off". A character value is written literally — useful when you already know the export-value string and want to bypass inference.

  • Combobox / listbox ("combobox", "listbox", "xfa_combobox", "xfa_listbox"): value must be a character scalar matching one of the field's options (pdf_form_field_options()).

Any other field type (button / signature / unknown) errors — those don't have a settable value.

Wraps FPDFAnnot_SetStringValue(annot, "V", ...) followed by a rect re-touch (FPDFAnnot_SetRect to the current rect) that flips the AP-dirty flag, so the next pdf_render_page() or pdf_save() rebuilds the widget's appearance stream from the new value.