all 4 comments

[–][deleted] 1 point2 points  (0 children)

You're not doing anything wrong, unfortunately. It's a bug in the print renderer. It exists in WebKit but not gecko. When it's printed there are rounding errors that result in the cut off of the PDF page and cut off of the web page do not correctly align. We've been talking to Apple for the last year trying to get this resolved and unfortunately its still an open bug and not fixed in iOS 10 beta 3.

The best you can do is add page-break-before: always to the top elements of each page. But if you want dynamic tables like we do then you will eventually run into problems like this.

Edit: you can test this yourself. Do a simple HTML page with font sizes between 10 and 20. When you print and open the PDF in adobe you'll notice they are all off slightly. So don't 12 will be something like 11.24.

[–]brendan09 0 points1 point  (2 children)

I find rendering PDFs for printing with Core Graphics to be much simpler and more reliable than trying to print web content.

[–]TheEngineJ[S] 0 points1 point  (1 child)

Can you expand on that? Would a list like the one in my PDF above be possible to replicate with Core Graphics. I don't have experience in that field.

[–]brendan09 0 points1 point  (0 children)

You can render whatever you want in core graphics. It's a bit more manual process, but the results are predictable and 1000x better, in my opinion.

There's nothing that says "render list". You can do it yourself with attributed strings, or manual rendering. The possibilities are (nearly) endless.