[poppler] API: Help getting PDF page into pixbuf
domlachowicz at gmail.com
Thu Apr 30 13:26:21 PDT 2009
You can render PopplerPage objects to any Cairo surface, including
image surfaces. Here's some pseudo-code that should get you in the
page = poppler_document_get_page();
width, height = poppler_page_get_size(page);
surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
cairo = cairo_create(surface);
// do what you want with the image surface, such as write it to disk
On Thu, Apr 30, 2009 at 2:51 PM, Angus March <angus at uducat.com> wrote:
> I need to have a PDF as an image, but the API documentation is very
> sparing with information, and I have some questions:
> 1. Do I use poppler_page_render_selection_to_pixbuf () to do this?
> 2. Assuming 1. is true, do I get page from
> poppler_document_new_from_file(), and the PopplerDocument instance
> from poppler_document_new_from_file()?
> 3. How do I interpret the data in pixbuf, or is that for another manual?
> 4. Can selection be made from the data returned by
> 5. What's a "Poppler selection style" and what difference does it
> make for this function?
> 6. I don't know what glyph_color and background_color should be.
> Isn't that sort of thing native to the PDF document?
> poppler mailing list
> poppler at lists.freedesktop.org
Mediocrity knows nothing higher than itself; but talent instantly
More information about the poppler