API referenceCore SDK

psrParsePage

Parse a page's content stream into the context's operator

C
BOOL32 __stdcall psrParsePage(PPDF IPDF, IPSR Ctx, void* UserData, PPDFParseCallbacks Funcs, uint32_t PageNum, TContentParseFlags Flags, PContentParseParms Parms, TContent* Value);
Delphi
function psrParsePage(const IPDF: PPDF; Ctx: IPSR; UserData: Pointer; Funcs: PPDFParseCallbacks; PageNum: Cardinal; Flags: TContentParseFlags; Parms: PContentParseParms; var Value: TContent): LongBool; stdcall;

Purpose. Parse a page's content stream into the context's operator program and text-run list, the prerequisite for every subsequent psr* operation (deletion, selection, search) against that page.

Description. PageNum is 1-based (matching pdfImportPage's convention, per an inline comment) and converted to 0-based internally. Respects a prior psrAbort call — if Ctx.Aborted is set, parsing is refused outright until a fresh context is created (there is no "un-abort" operation). Font-aware text decoding (Type0/TrueType 2-byte GID show-strings mapped through the document's GID→Unicode map, simple fonts falling back to WinAnsi) is applied while extracting text runs.

Parameters.

ParameterDescription
IPDFDocument handle.
CtxA parser context from psrCreateParserContext.
UserData, FuncsOptional low-level per-operator callback interface (mirrors pdfParseContent's callback dispatch, V03's content-stream cluster).
PageNum1-based target page.
Flags, ParmsParse behavior flags/params.
ValueOutput: the parsed operator-program summary (Count/OP).

Return value. True on success; False if IPDF/Ctx are invalid, the context was previously aborted, or the page's content could not be read.

C# (P/Invoke)

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

Misc

Exported names

psrParsePage

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.