PDA

View Full Version : Printing with "Auto-fit"



benfp
5th September 2009, 16:22
Hi,

I'm currently developping a QT application which I would like to print some contents on User Request. So far, I have not had any problems with the UI aspect of printing. In fact, my problem regards the actual printing.

I would like to know if it is possible to define a maximum number of pages (vertically and/or horizontally) in a way that the printed contents are always resized to fit in this number of pages.
Such feature would let me focus on the actual lay out of the contents instead of the contents size.

Such feature exists in software such as Microsoft Excel - the printed contents will be auto zoomed in/out so the contents fit on X pages wide and X pages high. Values for both entries can be either a number [1; +oo] or auto - auto meaning there will be no contents size adjusting.

Thanks for your time and consideration.

Ben

benfp
5th September 2009, 16:34
OK, I have successfully achieved to have such behaviour :
- using a pixmap which "grabs my widget" (QPixmap::grabWidget)
- and then scaling the pixmap using Qt::SmoothTransformation (otherwise it looks really ugly, which is no surprise).

Thanks for your time and consideration.