CSS force pagebreak

The below article applies to the old API, which has been replaced in february 2014 by the current way of working. For more info on current use of page breaking please visit pdfmyurl.com/page-sizes-and-page-breaking

We need a page break option as used in MS word, is this possible?

Page breaks can be forced by CSS, see: http://www.w3.org/TR/CSS21/page.html and http://davidwalsh.name/css-page-breaks.

We’ve uploaded a test file to our server for testing:


For things to work the following option should be set: –print-media-type, used for print media-type instead of screen.

The following url demonstrates the working of this:


Is there a way to tell to not cut pictures in half without them starting a new page?

Add a css style, create a div with that class for each block of text/ image/ whatever you do not want to break up

.nobreak { page-break-inside: avoid; }

Leave a Reply