int32_t __stdcall pdfGetAnnotFlags(PPDF IPDF);
BOOL32 __stdcall pdfSetAnnotFlags(PPDF IPDF, uint32_t Flags);
BOOL32 __stdcall pdfSetAnnotFlagsEx(PPDF IPDF, uint32_t Handle, int32_t Flags);
function pdfGetAnnotFlags(const IPDF: PPDF): Integer; stdcall;
function pdfSetAnnotFlags(const IPDF: PPDF; Flags: Cardinal): LongBool; stdcall;
function pdfSetAnnotFlagsEx(const IPDF: PPDF; Handle: Cardinal; Flags: Integer): LongBool; stdcall;
Purpose. Set/get the PDF /F annotation-flags bitmask — on the implicit "current annotation" (plain forms) or an explicit Handle (Ex).
Description. pdfGetAnnotFlags/pdfSetAnnotFlags are real, and operate on FCurrentAnnotHandle — see the chapter-level cursor note. pdfGetAnnotFlags defaults to 4 (afPrint — deliberately diverging from the classic API's default, per an inline DIFF comment) if the current annotation has no explicit /F entry yet. pdfSetAnnotFlagsEx is the handle-explicit sibling, otherwise functionally identical (both ultimately call the same SetAnnotFlagsH).
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
Handle | *(Ex only)* Explicit annotation handle. |
Flags | The PDF /F bitmask to store. |
Return value. pdfGetAnnotFlags: the current flags (default 4 if unset); 0 if IPDF invalid or no current annotation is tracked. pdfSetAnnotFlags/Ex: True on success.
See also. pdfSetAnnotIntProperty (Tag 0 also writes /F, a third path to the same key).
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Annotations
pdfSetAnnotFlagsEx
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.