Forum How do I...?

Turnover range to next page

garryw
New user of Prince needs help from the experts .... see attached image of problem.

Is there a setting to reduce the space left at bottom of page when pages break ?

In this example attached i could have easily fitted the 3 lines highlighted,

It is like the depth of page reaches a range then turns over.

Is that range configurable ?? as in this case it should be closer to footer allowing more text on page.

Any help would be greatly appreciated.

Garry
  1. Capture1.jpg74.8 kB
mikeday
Prince is probably trying to avoid a page break immediately after a heading. You can disable this behaviour with rules like this:
h1, h2, h3, h4 { page-break-after: auto }
garryw
Agreed that the heading rule that i have in place might cause issue around headings turning over and resulting in larger than normal white space at the bottom of the previous page.

However, (see attached) here are examples of other structures with no rules enforcing page breaks that exhibit the same issue ... pages turning over when clearly the turnover would fit and result in a more acceptable break.


  1. page_break.zip462.4 kB
hallvord
Hi garryw, it's hard to say what instructions might cause this without having a look at your source code. Could you possibly share a sample file or files that show the problem? If you don't wish to post them in a public forum you can E-mail me - same user name as this on site, just add @hallvord.com to create an E-mail address :).

Announcement: repos for tests/utils

garryw
Hi hallvord, do you refer to the html or resulting pdf ?
garryw
hallvord
Thanks - investigating the HTML/CSS code helps :)

I don't understand the exact purpose of this block of CSS:

    .footerpusher {
        min-height: 100%;
        position: relative;
        padding-bottom: 40px;
        overflow: hidden
    }


but removing the padding-bottom instruction here seems to allow Prince to create nicer pagination of this document. I do not know if this is a bug or a feature ;). The code is in this file:
http://www.legislation.nsw.gov.au/index.css?1164

Announcement: repos for tests/utils

hallvord
(Testing in web browsers shows this padding is meant to make sure the main content clears the footer without "underlapping" it. Perhaps isolating this rule in a @media screen block is a good idea? Not tested.. I will also try to figure out if Prince is doing the right thing or not.)

Announcement: repos for tests/utils

hallvord
Prince's behaviour is by design (and makes sense when you think about it: padding should be same on all pages).

You might try to write a compatibility-enhancing style sheet. For example save this:

.footerpusher{
    padding-bottom: 0 !important;
}


somewhere as style.css and use Prince's -s command line argument (or an equivalent for GUI) to apply that file as an extra style sheet:
prince -s style.css http://www.legislation.nsw.gov.au/#/view/act/1977/18/whole

(although this #-style page only works with JS enabled and doesn't load the right content since Prince doesn't support location.hash and reflow - so you'll have to run it on a local file..)

Announcement: repos for tests/utils

garryw
thanks for the help Hallvord the footerpusher is doing the trick
cheers