MeasureTextFlow

Text, Fonts

Description

Reports how many lines the rest of a flow needs at a given width.

Syntax

Delphi

Function TPDFlib.MeasureTextFlow(FlowID: Integer; Width: Double): Integer;

Parameters

FlowIDA handle from NewTextFlow.
WidthThe width the text would wrap to.

Return values

CountLines the remaining text needs.
0The flow is finished, or the handle is not valid.

Remarks

Measuring does not consume the flow, so a layout can be sized before it is committed to.

Lines are broken with the font selected when the call is made, so a caller that changes font or size between boxes - or starts a new page without reselecting one - gets different breaks and a different count. Keep the font settings the same across the boxes one flow runs through.

See also

DrawTextFlow, NewTextFlow