API referenceText

psrWriteToPage

Commit the pending edit staged by

CategoryInteractive text editing
NoteFlags/Parms accepted but entirely unused (see Remarks)

Purpose — Commit the pending edit staged by psrDeleteText or psrReplaceSelText back to the page.

Description — Writes Ctx.EditedContent to the page it was parsed from (Ctx.EditPage), and clears the pending-edit flag on success.

Declarations

C
BOOL32 __stdcall psrWriteToPage(PPDF IPDF, IPSR Ctx, TOptimizeFlags Flags, POptimizeParams Parms);
Delphi
function psrWriteToPage(const IPDF: PPDF; const Ctx: IPSR; Flags: TOptimizeFlags; Parms: POptimizeParams): LongBool; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
CtxIPSRContext with a pending edit.
FlagsTOptimizeFlagsAccepted for ABI compatibility; not read anywhere in this call's implementation — see Remarks.
ParmsPOptimizeParamsAccepted for ABI compatibility; not read anywhere in this call's implementation — see Remarks.

Return valueTRUE if there was a pending edit and it was written successfully; FALSE if Ctx has no pending edit (HasEdit=False), no valid edit page, or the write fails.

Remarks — compatibility parameters. TOptimizeFlags is a 30-bit enumeration (image conversion, compression, layer flattening, Bates-number removal, and more — the same flag type used by the SDK's document-level optimize/save routines elsewhere). None of it is consulted by this callpsrWriteToPage does exactly one thing: writes the staged edited content bytes back to the page. If your workflow expects any optimization behavior implied by Flags/Parms from this call specifically, it will not happen here.

See alsopsrDeleteText, psrReplaceSelText

C# (P/Invoke)

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

Misc

Exported names

psrWriteToPage

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.