giusepped
8th January 2009, 09:43
I would like to understand better the printing engine.
I would print a PDF under Windows: is it possible?
void MyPlot::printOut()
{
QPrinter printer(QPrinter::HighResolution);
printer.setOutputFileName(tr("diagrammasolare.pdf"));
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setCreator("Solar Calc");
printer.setOrientation(QPrinter::Landscape);
QPrintDialog dialog(&printer);
if ( dialog.exec() )
{
QwtPlotPrintFilter filter;
// if ( printer.colorMode() == QPrinter::GrayScale )
{
int options = QwtPlotPrintFilter::PrintAll;
options &= ~QwtPlotPrintFilter::PrintBackground;
options |= QwtPlotPrintFilter::PrintFrameWithScales;
filter.setOptions(options);
}
print(printer,filter);
}
}
With this code, which is good under windows, I cannot get printing the pdf under windows.
No dialog shows up and the message
only native format supported is shown.
So, is it possible to print pdf under Windows?
G
I would print a PDF under Windows: is it possible?
void MyPlot::printOut()
{
QPrinter printer(QPrinter::HighResolution);
printer.setOutputFileName(tr("diagrammasolare.pdf"));
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setCreator("Solar Calc");
printer.setOrientation(QPrinter::Landscape);
QPrintDialog dialog(&printer);
if ( dialog.exec() )
{
QwtPlotPrintFilter filter;
// if ( printer.colorMode() == QPrinter::GrayScale )
{
int options = QwtPlotPrintFilter::PrintAll;
options &= ~QwtPlotPrintFilter::PrintBackground;
options |= QwtPlotPrintFilter::PrintFrameWithScales;
filter.setOptions(options);
}
print(printer,filter);
}
}
With this code, which is good under windows, I cannot get printing the pdf under windows.
No dialog shows up and the message
only native format supported is shown.
So, is it possible to print pdf under Windows?
G