int32_t __stdcall pdfGetFieldFlags(PPDF IPDF, uint32_t AField);
BOOL32 __stdcall pdfSetFieldFlags(PPDF IPDF, uint32_t AField, int32_t Flags, BOOL32 Reset);
function pdfGetFieldFlags(const IPDF: PPDF; AField: Cardinal): Integer; stdcall;
function pdfSetFieldFlags(const IPDF: PPDF; AField: Cardinal; Flags: Integer; Reset: LongBool): LongBool; stdcall;
Purpose. Get/set the field's /Ff flags bitmask (ReadOnly/Required/ NoExport/Multiline/Password/etc, per field type).
Description. Reset is genuinely honored — a real, meaningful contrast to pdfSetGStateFlags's silently-dropped Reset parameter (Line Style, Opacity, and Graphics-State Flags): Reset = True clears the field's prior /Ff value before OR-ing in Flags (a true replace); Reset = False OR-merges Flags into the existing bitmask, preserving previously-set bits not present in the new Flags value. This confirms the Reset-parameter pattern is not universally dropped across this SDK — it depends on the specific function.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
AField | Target field handle. |
Flags | The bits to apply. |
Reset | True = replace the entire /Ff value with Flags; False = OR-merge Flags into the existing value. |
Return value. pdfGetFieldFlags: the current /Ff value; 0 if IPDF invalid. pdfSetFieldFlags: True if AField resolves.
See also. pdfSetGStateFlags (the contrasting sibling where Reset is dropped).
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Forms
pdfSetFieldFlags
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.