hi All
Someone could give me an simple example how to render a PDF page to
image.
using Poppler and wxPython. Thank you.
hi All
Someone could give me an simple example how to render a PDF page to
image.
using Poppler and wxPython. Thank you.
UlisesG wrote:
Someone could give me an simple example how to render a PDF page to
image. using Poppler and wxPython. Thank you.
well, with a quick googling, I can't seem to find any docs for the poppler python bindings. So, if you can figure out how to get poppler to render to an image buffer, we can probably tell you how to show that with wx, and least if you know a bit about what the poppler image buffer is like.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
I'm not sure if what you want to do is show a PDF within wxPython, but
if so, maybe this example from last year might help:
There's an image you can see in that message, as well as the code that
produced it.
Che
On Tue, Mar 2, 2010 at 7:47 PM, UlisesG <buscame52@gmail.com> wrote:
hi All
Someone could give me an simple example how to render a PDF page to
image.
using Poppler and wxPython. Thank you.--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
Careful about keeping the threads straight -- this could get lost.
Ulises G Ramirez A wrote:
Thanks for so fast response. I found a method in poppler:
page.render_to_pixbuf (x, y, sixex, SizeY, pixbuf)
The only problem is that pixbuf must be an object. gtk.gdk.pixbuf
Could you help me with this information??
That *may* be possible to get from wxGTK, but not from the other platforms. So it looks like you may need to go with the code Che pointed too -- which creates a Cairo context to pass to poppler.
I'm a little surprised poppler doesn't have a way to create a pixel buffer itself, but I guess it's designed to be tied to GTK. Too bad -- it sure could be useful in a GUI-free environment (web server, etc)
Not sure that helped much,
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
It's not poppler, but swftools has a module named 'gfx' that can
render a pdf page to a buffer you can read into a wx.Bitmap
http://wiki.swftools.org/index.php/Python_gfx_module
I think it's based on xpdf
- mh
On Mar 3, 11:13 am, Christopher Barker <Chris.Bar...@noaa.gov> wrote:
Careful about keeping the threads straight -- this could get lost.
Ulises G Ramirez A wrote:
> Thanks for so fast response. I found a method in poppler:
> page.render_to_pixbuf (x, y, sixex, SizeY, pixbuf)
> The only problem is that pixbuf must be an object. gtk.gdk.pixbuf
> Could you help me with this information??That *may* be possible to get from wxGTK, but not from the other
platforms. So it looks like you may need to go with the code Che pointed
too -- which creates a Cairo context to pass to poppler.I'm a little surprised poppler doesn't have a way to create a pixel
buffer itself, but I guess it's designed to be tied to GTK. Too bad --
it sure could be useful in a GUI-free environment (web server, etc)Not sure that helped much,
-Chris
--
Christopher Barker, Ph.D.
OceanographerEmergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main receptionChris.Bar...@noaa.gov