⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)
How to create a pdf or textfile in QT?
-
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?
-
@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.
-
@JonB thanks i will see.
-
Hi
Just as a note.
Using something like
https://sourceforge.net/projects/qtrpt/
might be more fun than handcrafting the layout using a painter.
-
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