Text poured into columns
One long passage poured into three columns, each fitting the lines its height allows and handing the rest to the next.
This page is the whole program, for whoever writes your software. There is nothing here to read otherwise. Go back to the document it writes.
write_columns.json
99 lines
This one is not a program. It is the request the document server is sent: the same page, asked for over the network by an application that writes no PDF code at all.
The library breaks the passage once, to the width of one column, then hands each column as many of the broken lines as its height allows. A request has no block of words that runs from the foot of one column into the head of the next, so the passage travels as three blocks, each already holding the words its column was handed. The lines fall in the same places, because a line is broken against the room in front of it. The first two columns stop in the middle of the passage and say so, for their last line to be spaced out like the ones above it; the third ends the passage and leaves its last line ragged. The library also draws the rule around a column as a rectangle, where a rectangle on the wire is its four corners walked round and closed.