It appears that the word wrapping algorithm only starts after the column wrapping algorithm has completed. It would be helpful if they were balanced to try to keep all columns on a single page, but if it is not possible, balance columns across pages. This will likely take a form similar to:
- Calculate an un-wrapped column width for each column.
- If un-wrapped fits on one page, then use that.
- If un-wrapped does not all fit on one page, calculate the minimum column width for each column. If minimum will fit on one page, put all columns on one page and then perform wrapping from there.
- If minimum will not all fit on one page, wrap the columns to subsequent pages using the minimum column width for column placement and then perform the current wrapping calculations to fit the columns per page.
- If there is a row too long to fit warning/error (in other words, a single row does not fit on a page), then make that row wider so that it fits on a single page and then recalculate which columns go on a page from step 3 or 4.
It appears that the word wrapping algorithm only starts after the column wrapping algorithm has completed. It would be helpful if they were balanced to try to keep all columns on a single page, but if it is not possible, balance columns across pages. This will likely take a form similar to: