API referenceText

psrDeleteText

Delete every text-showing operator whose origin point falls

CategoryInteractive text editing

Purpose — Delete every text-showing operator whose origin point falls inside a rectangle (or the whole page).

Description — Deletes whole Tj/TJ/'/" operators (not partial runs) whose text origin lies in [Area.Left, Area.Right] × [Area.Bottom, Area.Top]; Area=NULL deletes every text-showing operator on the page. Stages the edit on Ctx — does not touch the actual page content until psrWriteToPage is called.

Declarations

C
BOOL32 __stdcall psrDeleteText(PPDF IPDF, IPSR Ctx, PFltRect Area, TDeleteTextFlags Flags);
Delphi
function psrDeleteText(const IPDF: PPDF; const Ctx: IPSR; Area: PFltRect; Flags: TDeleteTextFlags): LongBool; stdcall; external 'LumasPdf.dll';

TDeleteTextFlags (from Lumas.Pdf.ApiTypes — only one value is defined):

Delphi
TDeleteTextFlags = (dtfDefault = 0);

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
CtxIPSRA parsed context from psrParsePage.
AreaPFltRectRectangle to delete text within; NULL = whole page.
FlagsTDeleteTextFlagsOnly dtfDefault (0) exists in this build's type — no alternative deletion modes are currently defined.

Return valueTRUE if the context and document are valid (stages the edit even if zero operators matched — this call does not distinguish "deleted N operators" from "deleted 0"; check the resulting extracted text if you need to know whether anything changed).

See alsopsrWriteToPage

C# (P/Invoke)

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

Misc

Exported names

psrDeleteText

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.