BOOL32 __stdcall psrParsePage(PPDF IPDF, IPSR Ctx, void* UserData, PPDFParseCallbacks Funcs, uint32_t PageNum, TContentParseFlags Flags, PContentParseParms Parms, TContent* Value);
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.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
Ctx | A parser context from psrCreateParserContext. |
UserData, Funcs | Optional low-level per-operator callback interface (mirrors pdfParseContent's callback dispatch, V03's content-stream cluster). |
PageNum | 1-based target page. |
Flags, Parms | Parse behavior flags/params. |
Value | Output: 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)
[return: MarshalAs(UnmanagedType.Bool)]
Misc
psrParsePage
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.