[poppler] rendering pages from PDFs to PNG

Hans-Werner Hilse hilse at sub.uni-goettingen.de
Thu Feb 16 05:55:38 PST 2006


Hi,

I'm developing and maintaining a web based service that renders pages
from PDFs online and places them as images into HTML pages. It's meant
as a quick preview.

While using ghostscript for this for a long time, I've recently
switched to xpdf. I extended Splash output by another function that
uses libpng in order to output single pages as PNGs. The patch is
rather small.

At that time, I hadn't yet known poppler. It seems to me that it is
already able to do something like this via the functions that cairo
offers (it seems to have PNG export). Sadly, I'm currently having a
hard time to find examples of how to
- use poppler in combination with cairo (but _not_ output to some X11
window or do other toolkit integration)
- make cairo give me PNG output (which I can understand is a little OT
here)

If anybody is able to give me some hints, I'd be very grateful.

OTOH, it wouldn't be too complicated to add PNG output via libpng to
poppler's Splash, too. But I don't like that design, as it fiddles with
internals taken over from xpdf and adds another dependency for
specialized function in a very non-specialized abstraction layer
(Splash). But if some people would like such an option, I can quickly
adopt my patch. Feedback is welcome.


-hwh


More information about the poppler mailing list