Forum Bugs

Unwanted Page Breaks Before Div Tags

vemcg
I am very impressed with PrinceXML and DocRaptor as they seem to be the only solutions that do a decent job of Paged Media support.

I do have a weird problem though. Any help would be most appreciated.

I am trying to format a novel using carefully polished (and I believe pristine) HTML as my input. I words very well on both PrinceXML (for local experimentation) and DocRaptor (in test mode and eventually for the final rendering).

I've got everything nearly perfect except for two unwanted page breaks - one in my copyright page and one in the first scene of chapter 7. The could be other unwanted page breaks, but none were apparent around the problem paragraphs I've been styling.

I can probably work around the first by leaving the embedded logo off the page and the second by choosing my font size so that I run out of page just before the unwanted break, but, gag, I'd rather understand what's going on and how to fix it.

I have attached a very much trimmed to the bone file that demonstrates the problem in both PrinceXML and DocRaptor. The problems are marked so you cannot miss them. As a side effect of the problem, page 3 (which should not exist) also gets a header (which I have successfully suppressed for the other front matter pages). Also, I'd love to figure out how to restart numbering on the first chapter.

I don't think the problem is in my CSS, although I'd love to be wrong about this as that would mean I could fix it and be done.

-- Vern
  1. page_break_problem_pdf.zip23.9 kB
    The zip archive contains a stand alone HTML file (no scripts or external dependencies whatsoever). Lines #249 and #469 seem to trigger the problem.
mikeday
The main issue appears to be named pages, which cause page breaks before and after the block to which they are applied. In the case of chapter 7, not all of the content appears to be actually nested inside the chapter <div> element, which ends before the email that appears on the next page. Similarly with the intro logo, that uses a named page ("onLeft") that doesn't seem strictly necessary.