From: Christopher B. <Chr...@no...> - 2007-12-27 18:08:22
|
Carl Karsten wrote: > 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, yup. > and there don't seem to be any python bindings. I've never seen any, but it would be cool! > now I need png=f(pdf). Would it really be that bad to write out the pdf file to disk and call ghostscript with system() or subprocess?. If you don't want the temporary file, you may be able to use subprocess to send it to ghostscript through a pipe. These types of solutions will be massively easier than trying to write a wrapper for ghostscript. > 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'd be hesitant of is making your first swig project such a complex one! Aside form python bindings, is ghostscript designed to be used as a library at all? I don't think I've ever seen it used that way. > 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 I agree. One other note -- why not use a tool that generates an image (PNG) in the first place, rather than going through PDF? Is this Dabo? (I'm guessing from the "dReportWriter" -- does it support any other output? It'd be nice if it did. -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 Chr...@no... |