API referenceText

pdfWriteFTextEx

Same as [pdfWriteFText](#api-pdfwriteftext), but sets the

CategoryText output / flowed text

Purpose — Same as pdfWriteFText, but sets the text rectangle explicitly in the same call.

Description — Calls SetTextRect(PosX, PosY, Width, Height) then WriteFlowText — the format-tag support, line-height rule, and alignment-override tags documented under pdfWriteFText all apply identically. This is generally the entry point to prefer, since it removes the easy-to-miss pdfSetTextRect precondition.

Declarations

C
BOOL32 __stdcall pdfWriteFTextExA(PPDF IPDF, double PosX, double PosY, double Width, double Height, int32_t Align, const char* AText);
BOOL32 __stdcall pdfWriteFTextExW(PPDF IPDF, double PosX, double PosY, double Width, double Height, int32_t Align, const wchar_t* AText);
Delphi
function pdfWriteFTextExA(const IPDF: PPDF; PosX, PosY, Width, Height: Double; Align: Integer; const AText: PAnsiChar): LongBool; stdcall; external 'LumasPdf.dll';
function pdfWriteFTextExW(const IPDF: PPDF; PosX, PosY, Width, Height: Double; Align: Integer; const AText: PWideChar): LongBool; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
PosX, PosYDoubleTop-left of the flow rectangle.
Width, HeightDoubleRectangle size. Both must be > 0 or nothing is drawn (mirrors SetTextRect's FHasTextRect gate).
AlignIntegerSame ta* values as TTextAlign, but passed as a plain Integer here (not the TTextAlign type) — functionally identical, just a looser ABI type on this overload.
ATextstringText to flow.

Return valueTRUE if at least one line was drawn; FALSE if Width/Height aren't both positive, no font is selected, or AText is empty.

See alsopdfWriteFText, pdfGetFTextHeightEx

C# (P/Invoke)

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

Text

Exported names

pdfWriteFTextExA pdfWriteFTextExW

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.