API referenceText

pdfWriteTextEx

Same as [pdfWriteText](#api-pdfwritetext), but takes an

CategoryText 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

C
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);
Delphi
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

ParameterTypeDescription
IPDFPPDFInstance handle.
PosX, PosYDoubleBaseline origin.
ATextstringText buffer, may contain embedded NULs.
LenCardinalExact element count to copy from AText.

Return valueTRUE 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 alsopdfWriteText

C# (P/Invoke)

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

Text

Exported names

pdfWriteTextExA pdfWriteTextExW

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.