API referenceText

pdfSetTextRect

Set the rectangle [pdfWriteFText](E01_CoreTextOutput.md#api-pdfwriteftext)

CategoryText state / flowed text

Purpose — Set the rectangle pdfWriteFText (the non-Ex form) and pdfGetFTextHeight (the non-Ex form) draw/measure into.

Description — This call cannot itself fail — it always returns TRUE (there is no document/page precondition, since it only stores four doubles). A rectangle is considered "active" (FHasTextRect) only when both Width and Height are > 0; passing 0 or a negative size for either deactivates flow text until reset.

Declarations

C
BOOL32 __stdcall pdfSetTextRect(PPDF IPDF, double PosX, double PosY, double Width, double Height);
Delphi
function pdfSetTextRect(const IPDF: PPDF; PosX, PosY, Width, Height: Double): LongBool; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
PosX, PosYDoubleTop-left of the rectangle.
Width, HeightDoubleSize; both must be > 0 to activate the rectangle.

Return value — Always TRUE on a valid handle.

See alsopdfGetTextRect, pdfWriteFText

C# (P/Invoke)

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

Setters

Exported names

pdfSetTextRect

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.