QT pdf
-
hi,
i was create pdf from qt-c++....now i have gui in qml ...i want to send this gui to create as pdf ..
-
try something like this:
@
QPrinter printer(QPrinter::HighResolution);
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(filename);
QPrintDialog printDialog(&printer);
if(printDialog.exec() == QDialog::Accepted)
{
mainWindow->render(&printer);
}
@or if you use Qt 5 you can use "QPdfWriter":http://qt-project.org/doc/qt-5.0/qtgui/qpdfwriter.html:
@
QPdfWriter pdfWriter("C:/mypdf.pdf");
mainWindow->render(&pdfWriter);
@ -
thank you for your reply Andre,
i have gui in qml...i want to print this gui as pdf....how to send this gui to this painter