From b1f0211637f657ff4d6962d9fab6ab620707fb34 Mon Sep 17 00:00:00 2001 From: Oliver Sander Date: Wed, 9 Aug 2017 11:09:50 +0200 Subject: [PATCH 2/2] Arthur: initialize the image with the paper color --- qt5/src/poppler-page.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qt5/src/poppler-page.cc b/qt5/src/poppler-page.cc index 0bba6180..b89c7c0a 100644 --- a/qt5/src/poppler-page.cc +++ b/qt5/src/poppler-page.cc @@ -410,6 +410,13 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h, QSize size = pageSize(); QImage tmpimg(w == -1 ? qRound( size.width() * xres / 72.0 ) : w, h == -1 ? qRound( size.height() * yres / 72.0 ) : h, QImage::Format_ARGB32); + QColor bgColor(m_page->parentDoc->paperColor.red(), + m_page->parentDoc->paperColor.green(), + m_page->parentDoc->paperColor.blue(), + m_page->parentDoc->paperColor.alpha()); + + tmpimg.fill(bgColor); + QPainter painter(&tmpimg); renderToPainter(&painter, xres, yres, x, y, w, h, rotate, DontSaveAndRestore); painter.end(); -- 2.13.2