I need to hardware-print a pdf file (already existing file) on a button click.
It’s like the file needed to print is already identified and present and upon clicking print button QPushButton this pdf file should be sent to printer queue without popping up a dialog for prinitng.
Is this possible with QPrinter or any other facility in Qt? (Platform is linux.)
In general, Qt has (as far as I know) no built-in way to do this. You need a program that understands how to convert PDF content into (for example) post-script to send to a printer.
A quick Google search came up with a library called “Poppler” that can render PDF content onto, say,
QImageinstances, and then you could print those.That said, if you are restricting yourself to linux, you could just create a
QProcessand call something like: