To export in pdf I use the following code
void MyPlot::exportPDF()
{
fileName
= QFileDialog::getSaveFileName(this, tr
("blabla"), recentExportPath,
"Acrobat ( *pdf)");
recentExportPath = fileInfo.absoluteDir().absolutePath();
if ( !fileName.isEmpty() ) {
fileName = MyMath::checkFormat(fileName,"pdf");
printer.
setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(fileName);
printer.setCreator("Test");
printer.
setOrientation(QPrinter::Landscape);
print(printer);
}
}
void MyPlot::exportPDF()
{
QString fileName;
fileName = QFileDialog::getSaveFileName(this, tr("blabla"), recentExportPath,"Acrobat ( *pdf)");
QFileInfo fileInfo(fileName);
recentExportPath = fileInfo.absoluteDir().absolutePath();
if ( !fileName.isEmpty() ) {
fileName = MyMath::checkFormat(fileName,"pdf");
QPrinter printer(QPrinter::HighResolution);
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(fileName);
printer.setCreator("Test");
printer.setOrientation(QPrinter::Landscape);
print(printer);
QDesktopServices::openUrl(fileName);
}
}
To copy to clipboard, switch view to plain text mode
but the pdf has the font on the axes cutted, as shown in the figure.test.png
The same result if I print on Adobe PDF printer.
Any suggestion?
Bookmarks