Skip to content

Instantly share code, notes, and snippets.

@jordanandree
Last active August 29, 2015 14:16
Show Gist options
  • Save jordanandree/5db87fdd22bdc4600c8c to your computer and use it in GitHub Desktop.
Save jordanandree/5db87fdd22bdc4600c8c to your computer and use it in GitHub Desktop.
selectable_text_macos.patch
From b0c7acf6c5ce127778f113041771d827defbc36d Mon Sep 17 00:00:00 2001
From: jordanandree <jordanandree at gmail.com>
Date: Wed, 11 Mar 2015 10:46:41 -0400
Subject: [PATCH] selectable text for pdfs on Mac OS
---
src/webpage.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/webpage.cpp b/src/webpage.cpp
index ff1d43e..93b9376 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -1097,6 +1097,11 @@ bool WebPage::renderPdf(const QString &fileName)
QPrinter printer;
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(fileName);
+
+ #ifdef Q_OS_MAC
+ printer.setOutputFormat(QPrinter::NativeFormat)
+ #endif
+
printer.setResolution(PHANTOMJS_PDF_DPI);
QVariantMap paperSize = m_paperSize;
--
2.3.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment