[ANN] python-ghostscript 0.4
Hartmut Goebel
h.goebel at crazy-compilers.com
Sat Jan 29 09:27:26 EST 2011
Announcing:
python-ghostscript 0.4
A Python-Interface to the Ghostscript
C-API using ctypes
:Copyright: GNU Public License v3 (GPLv3)
:Author: Hartmut Goebel <h.goebel at crazy-compiler.com>
:Homepage: http://bitbucket.org/htgoebel/python-ghostscript
:Download: http://pypi.python.org/pypi/ghostscript
`Ghostscript`__, is a well known interpreter for the PostScript
language and for PDF. This package implements a interface to the
Ghostscript C-API using `ctypes`__. Both a low-level and a pythonic,
high-level interface are provided.
__ http://www.ghostscript.com/
__ http://docs.python.org/library/ctypes.html
This package is currently tested only under GNU/Linux. Please report
whether it works in your environment, too. Thanks.
Latest Changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Fixed bug: typo in function call name ctypes.util.find_library
* (Unix) No longer try to load a specific version (version 8) of
libgs.so
* Added low-level interface for set_stdio() plus wrappers for
file handles
* (win32) Improved search for best Ghostscript installation:
Consider Aladdin and GNU Ghostscript, too; Check for existence of
DLL found in registry; take highest version available.
* Added win32 example-batch file for testing and other
improvements/fixes on examples an documentation.
Example
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here is an example for how to use the high-level interface of
`python-ghostscript`. This implements a very basic ps2pdf-tool::
import sys
import ghostscript
args = [
"ps2pdf", # actual value doesn't matter
"-dNOPAUSE", "-dBATCH", "-dSAFER",
"-sDEVICE=pdfwrite",
"-sOutputFile=" + sys.argv[1],
"-c", ".setpdfwrite",
"-f", sys.argv[2]
]
ghostscript.Ghostscript(*args)
--
Regards
Hartmut Goebel
| Hartmut Goebel | h.goebel at crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
More information about the Python-list
mailing list