API referenceCore SDK

psrCreateParserContext

Create/destroy a content-parser context — the handle every

C
IPSR __stdcall psrCreateParserContext(PPDF IPDF, TOptimizeFlags Flags, POptimizeParams Parms);
void __stdcall psrDeleteParserContext(IPSR* Ctx);
Delphi
function psrCreateParserContext(const IPDF: PPDF; Flags: TOptimizeFlags; Parms: POptimizeParams): IPSR; stdcall;
procedure psrDeleteParserContext(var Ctx: IPSR); stdcall;

Purpose. Create/destroy a content-parser context — the handle every other psr* function in this chapter (and the text-search/replace family in Interactive Text Search, Selection & Replacement) operates against.

Description. IPDF, Flags, and Parms are accepted by the ABI but unused — by design: the parser context carries no document-specific or optimize-flag-specific state at creation time; it is associated with a document only later, per-call, when psrParsePage(IPDF, Ctx, ...) is invoked. psrDeleteParserContext takes Ctx by reference and nils it out after freeing, preventing an obvious double-free via the same variable.

Parameters.

ParameterDescription
IPDF*(Create only)* Accepted but unused by design — the context is document-agnostic until psrParsePage.
Flags, Parms*(Create only)* Accepted but unused by design.
Ctx*(Delete only)* var — set to nil after the context is freed.

Return value. psrCreateParserContext: a new context handle (never fails). psrDeleteParserContext: none.

See also. psrCreateParserContext workflow (Interactive Text Search, Selection & Replacement's psrParsePage→find/edit→psrWriteToPage cycle).

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern IntPtr psrCreateParserContext(IntPtr IPDF, uint Flags, IntPtr Parms);
Area
Core SDK
Category

Misc

Exported names

psrCreateParserContext

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.