DrawTextFlowColumns
Text, Layout
Description
Flows the remaining text from left to right through equal-width columns in one page region
Syntax
Delphi
Function TPDFlib.DrawTextFlowColumns(FlowID: Integer; Left, Top, Width, Height: Double; Columns: Integer; Gutter: Double; Balance: Integer): Integer;ActiveX
Function PDFlib::DrawTextFlowColumns(FlowID As Long, Left As Double, Top As Double, Width As Double, Height As Double, Columns As Long, Gutter As Double, Balance As Long) As LongDLL
int DLDrawTextFlowColumns(int InstanceID, int FlowID, double Left, double Top, double Width, double Height, int Columns, double Gutter, int Balance);Parameters
| FlowID | Handle returned by NewTextFlow |
|---|---|
| Left, Top | Top-left position of the complete column region |
| Width, Height | Available size for the complete column region |
| Columns | Number of equal-width columns from 1 through 64 |
| Gutter | Non-negative space between adjacent columns |
| Balance | 0 fills each column to full height, while 1 balances a completed region |
Return values
Returns the total number of lines drawn, or 0 when nothing fits, the handle is invalid, or the geometry is invalid
Remarks
When Balance is 1 and all remaining text fits in the complete region, the function divides the exact remaining line count across the requested columns
When more text remains than the region can hold, every column keeps the full requested height so capacity is not reduced on intermediate pages
Balancing measures only up to one line beyond the region capacity, avoiding a full scan of a long passage that must continue to another page
Invalid geometry and a region too short for one line leave the flow cursor unchanged
Example
while PDF.TextFlowFinished(Flow)= 0 do
begin
PDF.DrawTextFlowColumns(Flow, 50, 60, 495, 720, 3, 18, 1);
if PDF.TextFlowFinished(Flow)= 0 then PDF.NewPage;
end;