Search code examples
imagepdfwxpythonwxwidgets

WxPython: How to display a pdf file object in a wxPanel?


I have a wxPython GUI. I would like to display the pdf object as an image inside a wxPanel on Mac/UNIX. What would I use?

Any advice or suggestions would be appreciated. Thank you in advance.


Solution

  • There is wxPDF:

    http://wxcode.sourceforge.net/components/wxpdfdoc/

    You can write your own wrapper for python if you are good enough with C++.

    Or you can try:

    http://www.wxpython.org/docs/api/wx.lib.pdfwin-module.html

    But that needs acrobat installed on the users system.

    edit:

    You could also use pdf2ps to convert every page (called from commandline so you don't violate the GPL if you are not releasing under GPL) and convert that to a png file with ghostscript. Not very elegant, but probably the best approach without using acrobat.