QPrinterEasy::setContent( ... )

14 views
Skip to first unread message

Andrea Caloni

unread,
Nov 30, 2011, 6:35:21 AM11/30/11
to qprint...@googlegroups.com
hello,
I have a question about using QPrinterEasy lib.
I have a QTextDocument which contains some page breaks.
Since the QPrinterEasy::setContent only accepts an html QString, I need to convert my QTextDocument to a QString using QTextDocument's function toHtml().
But doing this I loose the page breaks in the document.
Is there a way to mantain my page breaks ?
 
Thanks in advance.

With best regards

Andrea

Eric MAEKER

unread,
Nov 30, 2011, 7:03:08 AM11/30/11
to qprint...@googlegroups.com
Le 30 nov. 2011 à 12:35, Andrea Caloni a écrit :

hello,
I have a question about using QPrinterEasy lib.
I have a QTextDocument which contains some page breaks.
Since the QPrinterEasy::setContent only accepts an html QString, I need to convert my QTextDocument to a QString using QTextDocument's function toHtml().
But doing this I loose the page breaks in the document.
Is there a way to mantain my page breaks ?

Hi,

Use CSS style "page-break-before" and "page-break-after" in your HTML content.

Eg: Page break before H1
	<h1 style="page-break-before:always">Et deuxi&egrave;me page</h1>

Qt Doc here




Reply all
Reply to author
Forward
0 new messages