[poppler] rendering pages from PDFs to PNG

Carl Worth cworth at cworth.org
Thu Feb 16 06:59:10 PST 2006


On Thu, 16 Feb 2006 14:55:38 +0100, Hans-Werner Hilse wrote:
> - 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)

Kristian contributed a poppler-based pdf2png script which we use in
the cairo test suite. You can see it here:

http://cvs.cairographics.org/cairo/test/pdf2png.c?rev=1.1&view=markup

That version hides cairo more than I'd like. It would be a lot more
interesting if poppler had an interface to just render a PDF file to a
cairo_surface_t.

Oh, and I guess that's the problem you have in question #1. The
version above does require using poppler with GDK.

Kristian has mentioned interest in having the more direct cairo
integration in poppler. And I suspect it wouldn't really require much
new code in poppler---just a means for exporting the desired
interface.

If poppler did have more direct cairo integration, the answer to your
second question is that you would then just need to call:

	cairo_surface_write_to_png

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/poppler/attachments/20060216/65b19ad7/attachment.pgp


More information about the poppler mailing list