This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Page break after SVG not recognised

StudyPortals wrote on 2013-10-04:
I've been printing my pages with the REST API for a while now and have ironed out all issues except for one.
If you print this page with the following settings:
'height' => '297mm', // A4 height
'width' => '210mm', // A4 width
'margin_top' => '15mm',
'pdf_scaling_factor' => 1

you get the attached pdf, which looks great, except for page 3 where the block "Programme Performance" is directly followed by the block "Conversion of interested students". I have tried to get a page break after the conversion block, but no matter on what element I place the break-after / break-before, it will not brake. I've also added aditional divs to break on, but no luck.

Could you check why this is not working?

Cheers,
Danny
support wrote on 2013-10-04:
Hello Danny,

Could you send me a link to the version of the page with the page breaks?
StudyPortals wrote on 2013-10-07:
There is a link to the page in my original post. If you check out the div with the ID "ConversionGraph" you will see a break after which is not taken into account.

Anyway, here again the link:
http://administration.studyportals.eu/statistics/reports/shared/566/reports.html?token=d9c6afa0c961d3e40a347596e75309c2d86a3cce&view=print
support wrote on 2013-10-07:
Hello,

Thank you. Setting "page-break-after" on floating elements may not work in some contexts. Could you try to force a page break by inserting the following code into your document?
<div style="page-break-after:always"></div>
StudyPortals wrote on 2013-10-07:
I have already tried this, but apparently this also doesn't work.
I have added this to the page so you can check for yourself as well, but when we will release a new version on Wednesday it will be gone again.

But you are suspecting the floating element to be the problem?
support wrote on 2013-10-07:
Hello,

When I load your page in Firefox and Google Chrome and open the Print Preview dialog, both browsers do not insert that page break. This may indicate an incorrect use of the page-break-* property.

CSS 2.1, section 13.3.1 on page-break-* properties says:
"User Agents must apply these properties to block-level elements in the normal flow of the root element."

I'm not sure if your document violates this but I would recommend that you modify your document so that it is paginated correctly in the Print Preview first and then try it with Pdfcrowd.
StudyPortals wrote on 2013-10-08:
Ok, Thank you very much for your help, I will restyle the page in order to get the correct result.

Cheers,
Danny