[ctypes-users] ghostscript bindings
Brought to you by:
theller
From: Carl K. <ca...@pe...> - 2007-12-26 19:06:51
|
I am trying to convert pdf to png. (on an over loaded web server, so it needs to be done fairly efficiently) looks like I need to use ghostscript, and there don't seem to be any python bindings. Here is what the code looks like that generates the pdf: buffer = StringIO() rw = dReportWriter(OutputFile=buffer, ReportFormFile=xmlfile, Cursor=ds) rw.write() pdf = buffer.getvalue() return pdf so pdf is the same as if I had done: >>> pdf=open('foo.pdf').read() now I need png=f(pdf). I have never done anything with ctypes/swig or GS's API, so I am a bit hesitant to make my first project something that needs to run on the struggling web server. What I am really hoping for is to find that someone has already done this and somehow hidden it from google. Or, it it so simple that someone can whip it up for me in a few minutes. The alternative is to send the pdf to the web browser and let the user deal with it. It would just be nice if the image was part of the web page - more web 2.oh that way. Carl K |