From: Stefan Bund Date: Sat, 30 Oct 2010 22:01:00 +0000 (+0200) Subject: Enable PDF antialiasing X-Git-Url: http://g0dil.de/git?p=pykit.git;a=commitdiff_plain;h=106b1528ee204edad25362b274f5d8ffab16d757 Enable PDF antialiasing --- diff --git a/PDFWidget.cc b/PDFWidget.cc index 76c559d..a768e4f 100644 --- a/PDFWidget.cc +++ b/PDFWidget.cc @@ -27,6 +27,7 @@ prefix_ pykit::PDFWidget::PDFWidget(QString const & document, QNetworkAccessMana : QLabel(parent), manager_ (manager), currentPage_ (0) { document_.reset(Poppler::Document::load(document)); + documentSetup(); showPage(); } @@ -44,10 +45,18 @@ prefix_ void pykit::PDFWidget::netLoadDocument() return; QByteArray data (reply->read(reply->size())); document_.reset(Poppler::Document::loadFromData(data)); + documentSetup(); showPage(); reply->deleteLater(); } +prefix_ void pykit::PDFWidget::documentSetup() +{ + document_->setRenderHint(Poppler::Document::Antialiasing, true); + document_->setRenderHint(Poppler::Document::TextAntialiasing, true); + document_->setRenderHint(Poppler::Document::TextHinting, false); +} + prefix_ void pykit::PDFWidget::showPage() { if (! document_) diff --git a/PDFWidget.hh b/PDFWidget.hh index a6212ff..bbb7e51 100644 --- a/PDFWidget.hh +++ b/PDFWidget.hh @@ -37,6 +37,7 @@ namespace pykit { void netLoadDocument(); private: + void documentSetup(); void showPage(); QNetworkAccessManager * manager_;