PostScript libraries for Python
- python-ghostscript calls the Ghostscript library through ctypes. Anything the
gscommand does works from Python: PS to PDF, pages to PNG, text extraction, running PostScript from a string. GPL-3.0 (and Ghostscript is AGPL-3.0). - Pillow opens
.psand.epsfiles as images by calling thegsexecutable, and itsPSDrawmodule writes simple PostScript pages. Good for thumbnails. MIT-CMU (HPND). - pycairo is the Python binding of cairo. Draw vector graphics and text on a
PSSurfaceto produce multi-page PostScript. LGPL-2.1 or MPL-1.1.
Matplotlib also saves figures as PostScript (fig.savefig("plot.ps")); see Matplotlib for EPS.
- Pillow Pillow opens PostScript files as images through Ghostscript and writes simple PS pages with PSDraw. How to render a PS file to PNG in Python.
- pycairo pycairo is the Python binding of the cairo graphics library. How to install it and write multi-page PostScript files with text and shapes, set page sizes.
- python-ghostscript python-ghostscript is a ctypes interface to the Ghostscript C API. How to install it, convert PostScript to PDF, render PS pages to PNG.