[poppler] QT5 on Pi Render Performance for specific case

pqt at LEFerguson.com pqt at LEFerguson.com
Tue Nov 8 15:46:14 UTC 2016


I have been (and am) reading what I can find on performance generally, but I have a specific case and wonder if people might have suggestions.

I am writing an application to run on a Raspberry Pi 3, which renders PDF's.  These PDF's 99% of the time contain multiple pages each of which has exactly one image.  I create these, so I have some control over the type of image (I say "some" as I use Photoshop's Multi-page presentation automation and not completely sure what it does under the covers).

I realize I can pull images out separately, but I hesitate to do that because 1% (+/-) of the time there may be other things - annotations, or the source of the PDF may be elsewhere and I have no control.  But the vast majority have zero text or other artifacts other than the image.

At present to render a page at about  1200x900 takes almost 2 seconds on the Pi.  That's somewhere between impressive given it is a Pi, and too slow.  :)

Almost all the time is in the render call, specifically:

new QImage(popplerPage->renderToImage(desiredScale, desiredScale)
I've instrumented the QT program and very little is taken in putting up the image on the screen or other manipulation there.

My question is whether there are any sweet spots in the code you may suggest?  Anything I can do to the input image (color depth, format, etc.) that might speed the render, anything in settings in poppler?  I've tried Arthur and Splash and while the former is slightly faster it is not quite as good.  I am not using any rendering hints at present.  As I want to cache the image itself, Arthur's ability to render into a painter does not seem to help much (or maybe I'm missing how to best use it).

I've already adjusted the resolution of the scanned image to be as low as I can and still get crisp images at the final maximum size

The input image is indexed color (which is actually grey) as it comes from my scanner.  I could convert to a real grey scale, or to color.  I tried bitmap but it introduces some artifacts, though I may be able to manage a good pattern or setting.  Maybe.  Will it make much difference?   Or poppler going to do the same work regardless?

I am using the distro library on Ubuntu Mate for Pi, with CPP wrapper.

Any advice welcomed.  I am doing experiments, but there are so many variables, am hoping that people more knowledgeable of the code might know more fertile ground than random combinations.

On a mostly unrelated note -- any recommendations of a simple example of using QT bindings with poppler to create and save annotations?  That's next on my agenda.

Thanks,

Linwood



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler/attachments/20161108/54fb1e59/attachment.html>


More information about the poppler mailing list