Results 1 to 4 of 4

Thread: QGraphicsScene print ? or to pdf format?

  1. #1
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QGraphicsScene print ? or to pdf format?

    I have nearly ended with my converter xsl-fo -> QTextDocument, ( without java fop)
    but my BIG problem how I can print the scene? all item on position absolute on A4.
    I must re-unite all single piece to on QTextDocument? ( and lost top/left width..)

    Or how print all to pdf? as image the full QGraphicsScene?


    [HTML]
    <fo:block-container border-color="black" border-style="solid" border-width="1pt" height="1cm" width="14cm" top="11cm" left="4cm" padding="2pt" position="absolute">
    <fo:block text-align="start" space-after.optimum="3pt" line-height="15pt" font-family="sans-serif" font-size="12pt"> Please remit to the above address </fo:block>
    </fo:block-container>

    [/HTML]

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QGraphicsScene print ? or to pdf format?

    How about using QGraphicsScene::render()?

  3. The following user says thank you to wysota for this useful post:

    patrik08 (15th July 2007)

  4. #3
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGraphicsScene print ? or to pdf format?

    Quote Originally Posted by wysota View Post
    How about using QGraphicsScene::render()?
    the render is like image? and can handle printer.setOutputFormat(QPrinter::PdfFormat); ?

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QGraphicsScene print ? or to pdf format?

    The render is not "like image". It just outputs to a paint device and a printer is a paint device.

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.