Results 1 to 4 of 4

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

  1. #1
    Join Date
    Jul 2012
    Posts
    201
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default How can I convert a GraphicsItem into a pdf, png, or image for printing?

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How can I convert a GraphicsItem into a pdf, png, or image for printing?

    Have you tried QGraphicsScene::render()?

    Cheers,
    _

  3. #3

    Default Re: How can I convert a GraphicsItem into a pdf, png, or image for printing?

    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 before? As for myself, I am testing the related PDF to PNG converting, 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

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How can I convert a GraphicsItem into a pdf, png, or image for printing?

    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.

Similar Threads

  1. Qt Printing Good Image Quality.
    By cydside in forum Qt Programming
    Replies: 14
    Last Post: 12th August 2013, 21:26
  2. Replies: 2
    Last Post: 30th December 2011, 05:44
  3. How to convert JPEG image into binary data?
    By Gokulnathvc in forum Newbie
    Replies: 1
    Last Post: 7th June 2011, 08:43
  4. help printing html image with absulte url
    By jamo_ in forum Qt Programming
    Replies: 0
    Last Post: 11th April 2011, 01:17
  5. Image Quality when printing to PDF
    By JayMan8081 in forum Qt Programming
    Replies: 4
    Last Post: 25th August 2010, 18:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.