Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Recommendations: QPDFWriter or QPrinter::PdfFormat

Recommendations: QPDFWriter or QPrinter::PdfFormat

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 4 Posters 919 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ademmlerA Offline
    ademmlerA Offline
    ademmler
    wrote on last edited by
    #1

    Hi,

    I need to export a given QTgraphicsView to PDF.
    Shall I use QPdfWriter or QPrinter (QPrinter::PdfFormat) for that.
    What are the pros and cons.

    Regards Alex

    artwawA 1 Reply Last reply
    1
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      It depends on your goal. But on the QPdfWriter side, you have one less module to include and have more control about what you can put it there. But your users cannot send it to a printer.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • ademmlerA ademmler

        Hi,

        I need to export a given QTgraphicsView to PDF.
        Shall I use QPdfWriter or QPrinter (QPrinter::PdfFormat) for that.
        What are the pros and cons.

        Regards Alex

        artwawA Offline
        artwawA Offline
        artwaw
        wrote on last edited by
        #3

        @ademmler Like @SGaist said. If your solemn goal is to save as pdf, go with the writer. If, on the other hand, actual direct printouts should be possible - QPrinter is your friend for the sake of the flexibility.

        For more information please re-read.

        Kind Regards,
        Artur

        1 Reply Last reply
        2
        • ademmlerA Offline
          ademmlerA Offline
          ademmler
          wrote on last edited by
          #4

          Hi You two,

          thx for your recommendations. Thats was very helpful.
          To whom I should give the credit of the right answer?

          Alex

          artwawA 1 Reply Last reply
          0
          • ademmlerA ademmler

            Hi You two,

            thx for your recommendations. Thats was very helpful.
            To whom I should give the credit of the right answer?

            Alex

            artwawA Offline
            artwawA Offline
            artwaw
            wrote on last edited by
            #5

            @ademmler @SGaist was first to answer, I just added the rule of thumb ;)

            For more information please re-read.

            Kind Regards,
            Artur

            1 Reply Last reply
            0
            • JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              Also @SGaist is pretty short of thank-you-credits ;-)

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved