[poppler] PopplerPage should not cache image_dev
Kouhei Sutou
kou at cozmixng.org
Thu Mar 20 00:56:04 PDT 2008
Hi,
I find a problem of the GLib bindings.
poppler_page_get_image() always returns NULL after
poppler_page_get_image_mapping() is called. Because
PopplerPage.image_dev is cached when
poppler_page_get_image_mapping() is called. The cached
image_dev doesn't have CairoImageOutputDev.imgDrawCbk but
poppler_page_get_image() needs image_dev that has
image_draw_decide_cb() as CairoImageOutputDev.imgDrawCbk.
The following example shows poppler_page_get_image() always
returns NULL.
PopplerPage *first_page;
GList *image_mapping, *node;
first_page = poppler_document_get_page(document, 0);
image_mapping = poppler_page_get_image_mapping(page);
for (node = image_mapping; node; node = g_list_next(node)) {
PopplerImageMapping *mapping = node->data;
g_print("%d:%p\n",
mapping->image_id,
poppler_page_get_image(first_page, mapping->image_id));
}
poppler_page_free_image_Mapping(image_mapping);
g_object_unref(first_page);
Thanks,
--
kou
More information about the poppler
mailing list