NewTextFlow

Text, Fonts

Description

Creates a flow that carries one passage of text across several boxes.

Syntax

Delphi

Function TPDFlib.NewTextFlow(Const Text: WideString): Integer;

Parameters

TextThe whole passage to lay out.

Return values

HandleRelease it with ReleaseTextFlow.
0The text was empty.

Remarks

A flow keeps the text and a cursor into it. Each box takes as much as fits and leaves the cursor on the first word it could not take, so a passage runs on for as many boxes as it needs and the caller only decides where those boxes are. Drawing into a plain text box instead drops whatever overflows, with no way to learn what was lost.

Example

Flow:= PDF.NewTextFlow(Article);
while PDF.TextFlowFinished(Flow)= 0 do
begin
  PDF.DrawTextFlow(Flow, 60, 80, 200, 600);
  PDF.DrawTextFlow(Flow, 320, 80, 200, 600);
  if PDF.TextFlowFinished(Flow)= 0 then PDF.NewPage;
end;
PDF.ReleaseTextFlow(Flow);

See also

DrawTextFlow, MeasureTextFlow, ReleaseTextFlow