API referenceAnnotations

pdfGetAnnot

Read an annotation's core metadata (type, bounding box) by its

C
BOOL32 __stdcall pdfGetAnnot(PPDF IPDF, uint32_t Handle, TPDFAnnotation* Annot);
BOOL32 __stdcall pdfGetAnnotEx(PPDF IPDF, uint32_t Handle, TPDFAnnotationEx* Annot);
Delphi
function pdfGetAnnot(const IPDF: PPDF; Handle: Cardinal; var Annot: TPDFAnnotation): LongBool; stdcall;
function pdfGetAnnotEx(const IPDF: PPDF; Handle: Cardinal; var Annot: TPDFAnnotationEx): LongBool; stdcall;

Purpose. Read an annotation's core metadata (type, bounding box) by its document-wide handle, from any page.

Description. pdfGetAnnot resolves Handle through FAnnotByHandle (GetAnnotFull) — works regardless of which page is currently open. pdfGetAnnotEx additionally exposes a GAP-7-style object-descriptor handle (Annot.InkList) for Ink annotations specifically (AnnotType = atInk, type code 5): it sums every stroke's point count across the annotation's ink list and, if non-zero, mints a descriptor consumable elsewhere for detailed per-stroke point readback — for every other annotation type, InkList/InkListCount are left nil/0.

Parameters.

ParameterDescription
IPDFDocument handle.
HandleDocument-wide annotation handle.
AnnotOutput: type, bounding box (and, Ex+Ink only, the ink-list descriptor).

Return value. True if Handle resolves; False otherwise (Ex specifically fails when the resolved type code is 24, atUnknown).

See also. pdfGetPageAnnot (the unrelated, index-based enumeration mechanism).

C# (P/Invoke)

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

Annotations

Exported names

pdfGetAnnot

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.