Forum How do I...?

Making one-page documents

cculver
We have a forced one page 8.5x11 document that we are trying to reproduce in prince. This document has two variable-length text tables followed by an image that we want sized to take up the remaining space (or at least scale down if the above text is long enough to warrant it). Is this possible through prince and some creative CSS?
mikeday
I don't think so, there is no way to refer to remaining height on the page in CSS. :(
jim_albright
Since it is one page only, are you able to scale the picture manually? Or do you have hundreds of these one page documents?

Jim Albright
Wycliffe Bible Translators

cculver
We solved the problem, but unfortunately in a less-than-ideal way. We do a search on the appropriate height of the image. Our program changes the height through CSS, runs Prince, and using a 3rd party PDF library checks the number of pages in the document. If it has two pages, the size goes down. If one page, we try to maximize the height while keeping it to one page. Using this method we were able to get the desired results in a reasonable amount of time.