Using Ghostscript DLL via ctypes in Py2.3/Win
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Using Ghostscript DLL via ctypes in Py2.3/Win

From: Adam Twardoch <atwardoch@op.pl>
Date: Wed Jul 06 2005 - 11:36:31 CEST

I've written a simple commanline wrapper for calling GhostScript from
Python. It uses os.system under Windows and os.popen under unixes. The call
looks basically like this:

gs -q -dNODISPLAY -dNOPAUSE -dSAFER ps2ai.ps infile.eps >outfile.ai

I'd prefer to use the GhostScript DLL API* and call it using ctypes under
Windows. This way, I could package just the DLL with my application and the
user would not necessarily need to install the full GhostScript. However, I
don't really know how to handle ctypes very well.

Has anyone perhaps written something like that already and cares to share a
code snippet?

Regards,
Adam

*) http://www.cs.wisc.edu/~ghost/doc/cvs/API.htm
Received on Thu Sep 29 16:47:07 2005