THotPDF Loaded Form Field Editing Methods

Updates field constraints and widget appearance dictionaries in an existing AcroForm with correct incremental saving

Native field-flag editing retains the complete 32-bit mask, including high bits and low common flags, with the existing loaded-field inheritance rules

See AcroForm field flag precision for signed mask values, inheritance and native builder behaviour

Methods

SetLoadedFormFieldFlags  SetLoadedFormFieldMaxLength  SetLoadedFormFieldJustification
GetLoadedFormFieldWidgetCount  GetLoadedFormFieldWidgetRect  SetLoadedFormFieldWidgetRect
SetLoadedFormFieldRotation  SetLoadedFormFieldBorderColor  SetLoadedFormFieldVisibility

Use SetLoadedFormFieldJustification to set field quadding, then EnsureLoadedFieldAppearanceStream to regenerate the appearance; loaded listbox labels honour the effective /Q value without changing the /TI window or stored selections

Widget geometry

function GetLoadedFormFieldWidgetCount(FieldIndex: Integer): Integer;
function GetLoadedFormFieldWidgetRect(FieldIndex, WidgetIndex: Integer;
  out ARect: THPDFRect): boolean;
procedure SetLoadedFormFieldWidgetRect(FieldIndex, WidgetIndex: Integer;
  X1, Y1, X2, Y2: Single);

Widget appearance and visibility

procedure SetLoadedFormFieldRotation(FieldIndex, ADegrees: Integer);
procedure SetLoadedFormFieldBorderColor(FieldIndex: Integer;
  ARed, AGreen, ABlue: Single);
procedure SetLoadedFormFieldVisibility(FieldIndex: Integer;
  AVisible, APrintable: boolean);
procedure SetLoadedFormFieldBorderWidth(FieldIndex: Integer; AWidth: Single);
procedure SetLoadedFormFieldBackgroundColor(FieldIndex: Integer;
  ARed, AGreen, ABlue: Single);

Incremental update behaviour

Example

PDF.BeginIncrementalUpdate('input.pdf');
PDF.SetLoadedFormFieldMaxLength(0, 40);
PDF.SetLoadedFormFieldJustification(0, ffjCenter);
PDF.SetLoadedFormFieldRotation(0, 90);
PDF.SetLoadedFormFieldBorderColor(0, 0.1, 0.4, 0.8);
PDF.SetLoadedFormFieldWidgetRect(1, 1, 80, 150, 100, 170);
PDF.SaveIncrementalUpdate('updated.pdf');

Related APIs

Loaded form field methods · Loaded document toolkit · THotPDF