View Full Version : How to add page break when printe a webview to PDF format

18th December 2009, 01:32

I use QWebView to display some information and use QPrinter to convert the content to PDF format.

It worked. But the difficulty I am facing is how to add page break when it print to PDF?

- Is there any Html tag to control the page break in print output ?

Appreciate if anyone can help!


18th December 2009, 16:21
<STYLE TYPE="text/css">
P.breakhere {page-break-before: always}

This then will be the activator for the page break:

<P CLASS="breakhere">

You can set up as many different classes as you'd like as long as you keep following the same format as above.