| Category | Positional page-text replacement |
|---|---|
| Note | same "first-found, replace-everywhere" behavior as pdfReplacePageText |
Purpose — Unicode-capable sibling of pdfReplacePageText.
Description — ExA 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
BOOL32 __stdcall pdfReplacePageTextExA(PPDF IPDF, const char* NewText, TPDFStack* Stack);
BOOL32 __stdcall pdfReplacePageTextExW(PPDF IPDF, const wchar_t* NewText, TPDFStack* Stack);
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
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle with an active page. |
NewText | string | Replacement text. |
Stack | TPDFStack* | Accepted but not read. |
Return value — TRUE on at least one substitution; FALSE otherwise.
See also — pdfReplacePageText
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Core
pdfReplacePageTextExA
pdfReplacePageTextExW
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.