Forum How do I...?

Text overflow from the first page is mis-aligned on the second page.

mcevikce
I am pretty new to Prince. PDF created from the HTML does not match. Text overflow on the second page is shifting to the left, rather than matching the margins from the first page. I am attaching both the HTML and the PDF files.
  1. newfile.html8.8 kB
  2. test.pdf31.0 kB
markbrown
Hi,

It seems that Ctrl-P in both Chrome and Firefox produce output with similar alignment to that of Prince. Perhaps you've encountered a case where the browsers are not themselves consistent?

Mark
mcevikce
PDF file I attached is from prince conversion. If you look at the second page, alignment is off to the left. Yes, the alignment on Chrome and Firefox on the HTML and CTRL-P looks correct. PDF generated from Prince should match the html file.
markbrown
I've attached output from Chrome, Firefox and Prince for comparison, after making the document a bit longer so that it does actually fragment. All three show the alignment being off to the left after a page break. There aren't any page breaks when viewing it in the browser, but if you were to use a multicol container (in Chrome) then you would see the same effect after a column break. So I think this behaviour is expected.

May I ask what browser you are using, and/or what software you're using to create the HTML (if any)?
  1. newfile.chrome.pdf72.5 kB
  2. newfile.firefox.pdf25.9 kB
  3. newfile.prince.pdf47.3 kB
howcome
@mcevikce

The "shifting to left" is caused by a left-floating element with the word "Summary" in it. It only appears on the first page, and there it pushes other content to the right. This does not happen on the next pages.

As mark has shown, all browsers do this. And Prince.

If you want the shift to continue, you should us table layout, rather than floats.
mikeday
This is because there is a float on the first page pushing the table to the right, but that float is quite short and does not extend to the second page. You could use a different layout, such as putting the labels inside another table column instead of using floats, or you could add a left margin to the table and apply negative margins to the floats.