bryan.gv
27th May 2012, 05:38
Hi! ^^ I'm trying to print a PDF file without using QPrintDialog, I tried something like this:
QPrinter printer;
printer.setPrinterName("<printer's name>");
QTextDocument document;
document.setHtml("<h2>something</h2>");
document.print(&printer);
This works fine with a HTML file but I need to use a PDF file. I was looking for a way to wrap a PDF in a QDocument class or something similar but I haven't been successful :(
Thanks for your help!!!!! :)
QPrinter printer;
printer.setPrinterName("<printer's name>");
QTextDocument document;
document.setHtml("<h2>something</h2>");
document.print(&printer);
This works fine with a HTML file but I need to use a PDF file. I was looking for a way to wrap a PDF in a QDocument class or something similar but I haven't been successful :(
Thanks for your help!!!!! :)