Skip to main content

Interface to the Ghostscript C-API, both high- and low-level, based on ctypes

Project description

Author:

Hartmut Goebel <h.goebel@crazy-compiler.com>

Version:
Version 0.1

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.

This package is currently tested only under GNU/Linux. Please report whether it works in your environment, too. Thanks.

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)

Requirements and Installation

Please note:

This package is meant for developers. Even if there are some usable examples included, installations instructions are meant for developers.

python-ghostscript requires

  • Python 2.3 or higher (tested with Python 2.6)

  • ctypes when using Python 2.3 or 2.4 (ctypes is already

    included in Python 2.5 and higher)

  • setuptools or distribute for installation (see below).

  • Ghostscript Version 8.x

Installing python-ghostscript

Since this package is meant for developers, we assume you have experience in installing Python packages.

python-ghostscript is listed on PyPI (Python Package Index), so you can install it using easy_install or pip as usual. Please refer to the manuals of easy_install resp. pip for further information.

Alternatively you may download and unpack the source package of python-ghostscript from http://pypi.python.org/pypi/ghostscript and run:

python ./setup.py install

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

ghostscript-0.1.zip (32.0 kB view details)

Uploaded Source

ghostscript-0.1.tar.bz2 (19.4 kB view details)

Uploaded Source

File details

Details for the file ghostscript-0.1.zip.

File metadata

  • Download URL: ghostscript-0.1.zip
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ghostscript-0.1.zip
Algorithm Hash digest
SHA256 60038b5c8fd24dfc1c9e1fda559c554ba9a81a36a1eb6a67f58bcd97e9d73f65
MD5 d04196ddddafa9166722ee48ae62478e
BLAKE2b-256 79625299a45e004f53eb98a53eb1e78a7cae3de14413e263333fdd594d05ae50

See more details on using hashes here.

File details

Details for the file ghostscript-0.1.tar.bz2.

File metadata

  • Download URL: ghostscript-0.1.tar.bz2
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ghostscript-0.1.tar.bz2
Algorithm Hash digest
SHA256 ba71065e723f28ea241eb78b4e9139801720785b350962c307261b8550c5a9b5
MD5 b279397a927a5bc4096a372313e4354c
BLAKE2b-256 857a853ee8e18d50cd479d9f1df2f2bd1d900fd75367c311ed43e500ed4a0365

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page