Forum Bugs

Formatting issue with Prince 9

jhoweaa
We recently upgraded our environment to use Prince 9 from Prince 8. After the upgrade we noticed that the formatting of our reports was broken. I'm attaching two files which show the difference between what we see in a browser (html) vs what the Prince PDF produces. Note that Prince 8 produced a result which used to look like the html result. I'm also attaching a test file that was used to produce these results. I tried to cut out stuff that wasn't used, but the stylesheet probably still has some things that are used for this test page, but you should at least be able to use the file to compare results with different versions of Prince.

We really need to use Prince 9 because it has improved support for chart generation using Highcharts, but we can't use it unless we can figure out why our header formatting is dramatically different in Prince 9 from Prince 8 (and browsers)

Thanks!

Jim
  1. htmloutput.png7.6 kB
    Browser output
  2. princeDebug.html7.9 kB
  3. princeOutput.png6.8 kB
    Prince 9 r5 output
mikeday
Okay, a few things going on here. Firstly, the table.stats could be "display: inline-table" instead of inline-block, that would make more sense. A bunch of th elements have "white-space: nowrap", but not all of them, and so some of them are breaking. Finally, the document is styled differently for @media print and @media screen, and that seems to be making the table too tall for its container for @media print.
jhoweaa
I'm happy to make adjustments, but I'm wondering why this works fine in Prince 7/8 but not 9?
jhoweaa
One other comment, most of the changes in @media print were made to make the PDF output look identical (or as close as possible) to what we were seeing in the HTML. That's why it's bothersome that switching from Prince 8 to Prince 9 is causing this formatting issue. Like I said, I'm willing to make adjustements, if I can figure out what needs changing. I'm currently in the process of experimenting to see if I can get something to work.
jhoweaa
I just tried commenting out some of the media print statements and I got the formatting to work. I just need to figure out which ones really had an impact.
jhoweaa
So after messing around with things, it seems that the CSS style that throws things off is setting the height of the table stats table to 20mm. In my sample, if I comment that line out things look fine. I also changed that definition to use 'inline-table' instead of 'inline-block'. Those two changes seem to have fixed the problem. I'll have to see what it looks like in Prince 8 to see if that causes any problems (we're currently only running Prince 9 on an internal site for testing, our production site is still on Prince 8). I just noticed that height is not a valid CSS property for table. Perhaps that is why it isn't working the way I expect!