API referenceText

pdfGetTextRect

Read back the current flow-text rectangle set by

CategoryText state / flowed text

Purpose — Read back the current flow-text rectangle set by pdfSetTextRect.

Declarations

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

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
PosX, PosY, Width, HeightDouble*Receive the last-set rectangle, regardless of the return value (see Return value).

Return valueTRUE if a rectangle with positive Width and Height has been set (FHasTextRect); FALSE otherwise. The out-parameters are still written even when the return value is FALSE — they carry whatever values were last passed to pdfSetTextRect (possibly a degenerate 0×0 rect if never set), so check the return value, not just the out-parameters, to know whether a valid rectangle is active.

See alsopdfSetTextRect, pdfWriteFText

C# (P/Invoke)

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

Getters

Exported names

pdfGetTextRect

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.