API referenceAnnotations

pdfSetAnnotFlags

Set/get the PDF /F annotation-flags bitmask — on the

C
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);
Delphi
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.

ParameterDescription
IPDFDocument handle.
Handle*(Ex only)* Explicit annotation handle.
FlagsThe 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)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Annotations
Category

Annotations

Exported names

pdfSetAnnotFlags

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.