[okular] [Bug 362856] [Frameworks] Wrong render resolution, possibly caused by Plasma 5 "Scale Display"

Christoph Cullmann bugzilla_noreply at kde.org
Sun Jan 8 14:39:05 UTC 2017


https://bugs.kde.org/show_bug.cgi?id=362856

Christoph Cullmann <cullmann at kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cullmann at kde.org

--- Comment #21 from Christoph Cullmann <cullmann at kde.org> ---
I did take a look, IMHO the problem (beside the missing 

   // These attributes must be set before a Q(Gui)Application is constructed.
+    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+    QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);

calls) is that the generators render the stuff in a QImage but that has not set
the right scale factor nor dimensions.

During writing our company PDF helper viewer
(https://github.com/AbsInt/FirstAid), I run into the same issue with libpoppler
and altered our rendering code to:

            /**
             * we render in too high resolution and then set the right ratio
             */
            cachedPage = new QImage(page->renderToImage(resX() *
devicePixelRatio(), resY() * devicePixelRatio(), -1, -1, -1, -1,
Poppler::Page::Rotate0));
            cachedPage->setDevicePixelRatio(devicePixelRatio());

This did the trick, unfortunately Okular is more complex than our toy program
therefore I am not that sure where to adjust that :/

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Okular-devel mailing list