PDA

View Full Version : How can I convert a GraphicsItem into a pdf, png, or image for printing?



ayanda83
7th April 2015, 05:32
Hi guys, I am designing an application for making pamphlets and brochures. I have used the QGraphicsItem to represent the pamphlet pages and now I am facing a problem of how do I convert the QGraphicsItem into a pdf or png for printing.

Thanking you in advance.

anda_skoa
7th April 2015, 07:15
Have you tried QGraphicsScene::render()?

Cheers,
_

peterlee
21st December 2015, 13:06
Hi, ayanda83.
As for me, I have seldom tried to convert a GraphicsItem into a pdf, png, or image for printing. I wonder have you ever worked it out? Do I need another 3rd party manual toolkit? When it comes to PDF converting process, I have another question, I wonder have you ever tried to convert pdf to other image files (http://www.pqscan.com/pdf-to-image/) before? As for myself, I am testing the related PDF to PNG converting (http://www.pqscan.com/convert-pdf/to-png-csharp.html), PDF to BMP converting, and PDF to JPG converting programs these days. Do you have experience about it? Any suggestion will be appreciated. Thanks in advance.



Best regards,
Lee

ChrisW67
21st December 2015, 20:08
As anda_skoa pointed out, you render the scene to a paint device. That device can be a physical printer, QImage or PDFfile.

Conversion of PDF files into a series of page images (or the like) has nothing directly to do with Qt. Ghostscript and Imagemagick both have conversion abilities along those lines.