Forum Bugs

Another page-breaking problem

jeric
Hi,

We found another problem with pagebreaking. It looks very similar to the bug described in my earlier post (which is now fixed)


A simple testcase which demonstrates the problems is the following:

<style>
  div 
  { 
    width: 25px; 
    height: 125px; 
    background-color: blue; 
    page-break-after: avoid;
  }
</style>

<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>


The real case is a bit more complicated, but the outcome is the same:

<div>
  <div>block header</div>
  <div>
     <div>
        <div>header</div>
        <div>
           <table>
              <thead>
              </thead>
              <tbody>
                 ... content spans more than 1 page
              </tbody>
           </table>
        </div>
     </div>
  </div>
</div>


The result is that the blockheader, the header and the table all start on a page of their own.

What we want is the blockheader, the header and the first part of the table to appear on the first page, and the last part of the table on the second page (and if needed the third etc etc).

When splitting a collection of elements that shouldn't be broken apart according to the page-breaking rules prince should (in my opinion) always aim to minimize the number of pages the content is split to.

PS: I thought I posted this message last night .. but it seems to be eaten (or I was to sleepy to hit the submit button ..)
mikeday
Testing here it seems that we have fixed this problem, and the next maintenance release should handle it correctly.
jeric
Ah, very nice .. any idea when the next maintenance release is released? (I really like to ship it with our next software release which is due for januari)
mikeday
As soon as possible, hopefully in the next couple of weeks.
mikeday
Okay, it ended up being a month rather than a few weeks, but the new maintenance release is out now and should hopefully solve your problem. :)
jeric
Hi,

The release indeed fixes most of our problems! Tnx! (and it was just in time for our new (also delayed) release).

There is still one minor problem left:

<style>
  div
  {
    width: 25px;
    height: 125px;
    background-color: blue;
    page-break-after: avoid;
  }
</style>

<div>&nbsp;</div>
<div style="height: 2000px">&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div> 



The second div is now started on a separate page. For us this is not what we want (the first div representing a block header and the second div representing a visualization, this means a single line of text on the first page and a visualization which is broken onto multiple pages)
We now fixed this by letting the user specify wether to allow page breaking inside a visualization or not.

In our case we want to avoid page breaking inside a visualization only if the visualization fits on one page. I don't know if this is generally a good thing but something like

page-break-inside: -prince-avoid-if-fits-page

would be really helpfull for us.