| Category | Text output |
|---|
Purpose — Same as pdfWriteText, but takes an explicit length instead of relying on a NUL terminator.
Description — Copies exactly Len bytes/chars from AText (which may contain embedded NULs) into a buffer, then calls the same WriteTextA/WriteTextW as the non-Ex form — all Unicode-handling behavior documented under pdfWriteText applies identically here. Note: the plain pdfWriteTextA also takes the instance mutex lock (D.Lock/D.Unlock) around the write; pdfWriteTextExA does not — a further verified inconsistency, this time within the A variants themselves (Ex skips the lock that the non-Ex form takes).
Declarations
BOOL32 __stdcall pdfWriteTextExA(PPDF IPDF, double PosX, double PosY, const char* AText, uint32_t Len);
BOOL32 __stdcall pdfWriteTextExW(PPDF IPDF, double PosX, double PosY, const wchar_t* AText, uint32_t Len);
function pdfWriteTextExA(const IPDF: PPDF; PosX, PosY: Double; const AText: PAnsiChar; Len: Cardinal): LongBool; stdcall; external 'LumasPdf.dll';
function pdfWriteTextExW(const IPDF: PPDF; PosX, PosY: Double; const AText: PWideChar; Len: Cardinal): LongBool; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
PosX, PosY | Double | Baseline origin. |
AText | string | Text buffer, may contain embedded NULs. |
Len | Cardinal | Exact element count to copy from AText. |
Return value — TRUE on success; FALSE if AText is NULL or a precondition fails. Len=0 is accepted but writes nothing meaningful (an empty string is rejected by the underlying writer).
See also — pdfWriteText
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Text
pdfWriteTextExA
pdfWriteTextExW
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.