API referenceText

pdfReplacePageTextEx

Unicode-capable sibling of

CategoryPositional page-text replacement
Notesame "first-found, replace-everywhere" behavior as pdfReplacePageText

Purpose — Unicode-capable sibling of pdfReplacePageText.

DescriptionExA behaves identically to the non-Ex form. ExW adds font-aware re-encoding: the replacement text is re-encoded into the matched run's own font's show-string codes (2-byte Identity-H GIDs for embedded TrueType, UTF-16BE for a UCS2 CID font, WinAnsi bytes for a simple font) — the same mechanism documented for psrReplaceSelText. Stack is, again, accepted but not read by either variant.

Declarations

C
BOOL32 __stdcall pdfReplacePageTextExA(PPDF IPDF, const char* NewText, TPDFStack* Stack);
BOOL32 __stdcall pdfReplacePageTextExW(PPDF IPDF, const wchar_t* NewText, TPDFStack* Stack);
Delphi
function pdfReplacePageTextExA(const IPDF: PPDF; const NewText: PAnsiChar; var Stack: TPDFStack): LongBool; stdcall; external 'LumasPdf.dll';
function pdfReplacePageTextExW(const IPDF: PPDF; const NewText: PWideChar; var Stack: TPDFStack): LongBool; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle with an active page.
NewTextstringReplacement text.
StackTPDFStack*Accepted but not read.

Return valueTRUE on at least one substitution; FALSE otherwise.

See alsopdfReplacePageText

C# (P/Invoke)

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

Core

Exported names

pdfReplacePageTextExA pdfReplacePageTextExW

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.