PDA

View Full Version : Multipage Printing



Ryo Saeba 83
25th January 2006, 11:35
I need to print a table of data, I used a QTextEdit to layout a simple html table but I have a problem...
How can I repeat the first row with the header data for each page that needs to be printed?

*EDIT*
I am using Qt-4.1

Mike
25th January 2006, 12:20
well haven't done so myself, but I would assume that when printing, you can get the device caps, meaning the height and width of the printing device - here a piece of paper (Letter/A4/...) so you would need to get the height of a line in pixel, then calculate how many lines would fit onto one page ...
When the new page starts you can print out the header again, and then append the remaining lines until all have been rendered onto the printer device. Don't you not also get events when a page has been done and a new one starts? You should try looking in that direction. Look at: http://doc.trolltech.com/4.1/qprinter.html there you find a method called pageRect() which would be something you need...

ball
25th January 2006, 14:17
is there any open-source library that can handle this well which support utf-8?

i know for java there is a 'jasper report' that can write xml tag to format a beautiful report printing which the developer no need to care about those 'header' or 'footer' drawing stuff himself

Opilki_Inside
25th January 2006, 14:54
What about creating reports in RTF?