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. How to create a pdf or textfile in QT?
Qt 6.11 is out! See what's new in the release blog

How to create a pdf or textfile in QT?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 744 Views 1 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.
  • A Offline
    A Offline
    Aromakc
    wrote on last edited by
    #1

    I want to create a PDF (Invoice) of my sold items which includes (Company info), Customer name, Sold Item, Total price, etc. I have searched and thought of using QPrinter and Qpainter. Just wanted to know reliable ways and how to use them?

    JonBJ 1 Reply Last reply
    0
    • A Aromakc

      I want to create a PDF (Invoice) of my sold items which includes (Company info), Customer name, Sold Item, Total price, etc. I have searched and thought of using QPrinter and Qpainter. Just wanted to know reliable ways and how to use them?

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @Aromakc
      There is https://doc.qt.io/qt-5/qtpdf-pdfviewer-example.html.
      There is the whole https://doc.qt.io/qt-5/qpdf.html namespace classes.

      A 1 Reply Last reply
      4
      • JonBJ JonB

        @Aromakc
        There is https://doc.qt.io/qt-5/qtpdf-pdfviewer-example.html.
        There is the whole https://doc.qt.io/qt-5/qpdf.html namespace classes.

        A Offline
        A Offline
        Aromakc
        wrote on last edited by
        #3

        @JonB thanks i will see.

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi
          Just as a note.
          Using something like
          https://sourceforge.net/projects/qtrpt/
          might be more fun than handcrafting the layout using a painter.

          1 Reply Last reply
          3
          • T Offline
            T Offline
            thecodemonkey
            wrote on last edited by
            #5

            obviously there are many ways to achieve this. You could make a LaTeX/XeTeX file containing placeholders and replace them using Qt, then render to PDF using pdftex command line tool

            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