API referenceAnnotations

pdfCheckPageAnnots

Scan every page's annotation list for structurally malformed

C
int32_t __stdcall pdfCheckPageAnnots(PPDF IPDF);
Delphi
function pdfCheckPageAnnots(const IPDF: PPDF): Integer; stdcall;

Purpose. Scan every page's annotation list for structurally malformed entries (not a resolvable PDF dictionary, or missing the mandatory /Subtype//Rect keys).

Description. Iterates every page's CreatedAnnots, counting an entry as defective if it doesn't support IPdfDict at all, or does but is missing /Subtype or /Rect. This is a pure read-only diagnostic — it does not repair or remove anything it finds; a non-zero result flags a document integrity problem for the caller to investigate separately (e.g. via manual inspection or pdfDeleteAnnotation).

Parameters.

ParameterDescription
IPDFDocument handle.

Return value. The count of structurally malformed annotation entries found across the whole document; -1 if IPDF is invalid; 0 means every annotation is structurally sound.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfCheckPageAnnots(IntPtr IPDF);
Area
Annotations
Category

Validation

Exported names

pdfCheckPageAnnots

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.