Forum How do I...?

shrink-to-fit does not work for after page break

johnt2
shrink-to-fit does not work for after page break, here is the example:

@page {
margin: 10pt 20pt 40pt 20pt ;
prince-shrink-to-fit: auto;
}


<html>
<body>
First Page
<p style="page-break-before: always">
<pre>
Second Page - preserve format
Refunding, AMBAC Insured, Weekly VRDN and Put, 6.60%, 12/01/29 .......... 4,000,000 4,000,000
</pre>
</body>
</html>

Thanks!
johnt2
Anyone can confirm if it is the bug or limitation of Princexml? Thanks!
mikeday
This does seem a bit surprising, apparently we only use the width of the content on the first page to determine the necessary shrink factor.
johnt2
Thanks for the confirmation Mike!
henning
Hi,

We are having the same problem. If the page that is too wide is not the first page of the document then shrink-to-fit does not work.

Is there a way to fix this?

Thanks!

Henning

Clipboard01.png
  1. Clipboard01.png89.6 kB
mikeday
A quick workaround would be to use the new CSS3 transforms support to scale down the large table, eg. "transform: scale(0.75)".
michiel
This has been on your roadmap for a while. We would really like to see this fixed. Any idea when you'll work on this? Thanks.
mikeday
It turns out to be rather difficult to do. Would it be possible to scale down the entire document by a fixed percentage instead, or do you have documents with widely varying unknown width?
michiel
We have tables like the example above, but the user can select the amount of columns themselves. Anything above 10 columns is cut of most of the time. We would like to shrink-to-fit those tables. Scaling them down with transform is not really an option because of the large variety of sizes.
joelmeador
Michiel asked us to +1 this in DocRaptor support. This is not the first time I've heard about the way this works, and I know it surprised me the first time I ran into it. Even having a workaround where you could id a page and specify particular pages to calculate differently would be better.
mikeday
Right, we will investigate.