Skip to content

Commit

Permalink
Fix for PDF text not being selectable on Mac OSX.
Browse files Browse the repository at this point in the history
Produces selectable text when printing/rasterizing to PDF on OSX.

ariya#10373
  • Loading branch information
ragulka committed Oct 31, 2013
1 parent 6a01a8d commit 0663263
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/webpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,14 @@ bool WebPage::renderPdf(const QString &fileName)
QPrinter printer;
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(fileName);

// Fix for PDF prints on Mac OSX. Produces selectable text
#ifdef Q_WS_MACX
if(fileName.endsWith(".pdf")) {
printer.setOutputFormat(QPrinter::NativeFormat);
}
#endif

printer.setResolution(PHANTOMJS_PDF_DPI);
QVariantMap paperSize = m_paperSize;

Expand Down

0 comments on commit 0663263

Please sign in to comment.