[reportlab-users] Custom page lengths

Glenn Linderman v+python at g.nevcal.com
Tue Apr 12 00:50:57 EDT 2016

I'm wondering if there is a way to dynamically alter the page length 
based on the content.

Data is organized into pages of related information; but the data is 
variable length.

Nearly every device has some sort of PDF viewer; multiple screen size 

Already coded: formatting the data to different widths so that it is 
easier to read on various devices from cell phone to tablets, with 
reasonable font sizes and not needed to scroll sideways.

But that means that the already variable amount of data on the page gets 
exacerbated at small widths; for viewers that have an option to scroll 
pages horizontally, it isn't to bad to have long pages for all pages, 
even though only a few need them.

But for viewers that scroll pages vertically, there is a lot of white 
space to skip.  Variable size pages would help this.

I already have a PgBrk callback to make sure that the data stays on one 
page (so I can length the page until I quit getting errors from that 

But I simply don't know if it is possible to set the page size 
dynamically, after it is known where the last data falls... or, really, 
to know exactly where the last data falls.

Has anyone done anything like this before, or have ideas where to start?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20160411/e51f4042/attachment.html>

More information about the reportlab-users mailing list