Re: No more poppler_page_render_to_pixbuf() in Ubuntu 12.04
- From: Tadej Borovšak <tadeboro gmail com>
- To: Craig <craigbakalian verizon net>
- Cc: gtk-list gnome org
- Subject: Re: No more poppler_page_render_to_pixbuf() in Ubuntu 12.04
- Date: Sun, 29 Apr 2012 01:36:03 +0200
Hello.
> I used the code below to render a page of a pdf to a scrolled window in
> a gtk application of mine. After downloading Ubuntu 12.04 I get that
> there is no more support for poppler_page_render_to_pixbuf(). I do know
> that we are supposed to use cairo. But how? How do I replace the code
> below with cairo? What are we supposed to use, total cairo or
> gdk_cairo_create().
I can see 2 different ways of dealing with this API removal. To reuse
as much existing code as possible, you can create
cairo_image_surface_t, let poppler render your page there using
poppler_page_render() and write your own function that will convert
between cairo_image_surface_t and GdkPixbuf.
Another way would involve replacing GtkImage widget with
GtkDrawingArea and drawing your page directly from expose-event/draw
signal handler. Details will depend on whether you'll use GTK+-2 or
GTK+-3.
Cheers,
Tadej
--
Tadej Borovšak
blog.borovsak.si
tadeboro gmail com
tadej borovsak gmail com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]