Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oddbloke/pypostscript
Create postscript output from Python objects
https://github.com/oddbloke/pypostscript
Last synced: about 1 month ago
JSON representation
Create postscript output from Python objects
- Host: GitHub
- URL: https://github.com/oddbloke/pypostscript
- Owner: OddBloke
- Created: 2012-03-01T12:02:40.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-03-01T16:24:20.000Z (almost 13 years ago)
- Last Synced: 2023-04-14T02:16:11.694Z (over 1 year ago)
- Language: Python
- Homepage: http://pypi.python.org/pypi/pypostscript
- Size: 228 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
pypostscript
============Create A4 Portrait PostScript output with Python Objects
Version 0.1:
- Portrait A4 only
- 4 Font choices
- Text Lines
- Barcodes:
- Code 39
- Code 93
- Circles
- Rectangles
Source
======Source at: https://github.com/mhenwood/pypostscript/
Usage
=====Example of usage::
from pypostscript.barcode import Code39Barcode, Code93Barcode
from pypostscript.shapes import Circle, Rectangle
from pypostscript.text import HelveticaBoldFont, TextLine, TimesPlainFont
from pypostscript.page import Pagedef sample_page():
page = Page()
page.extend(TextLine(x_pts=40,
y_pts=740,
font=HelveticaBoldFont(size_pts=22),
text='A Test Portrait Page'))
page.extend(TextLine(x_pts=40,
y_pts=650,
font=TimesPlainFont(size_pts=12),
text='PostScript library, test portrait page.'))
page.extend(Code39Barcode(x_pts=40,
y_pts=500,
chars='ABC123'))
page.extend(Code93Barcode(x_pts=40,
y_pts=400,
chars='ABC987'))
page.extend(Rectangle(x_pts=30,
y_pts=390,
width_pts=170,
height_pts=185,
line_width_pts=2))
page.extend(Circle(centre_x_pts=80,
centre_y_pts=150,
radius_pts=72,
line_width_pts=1))
return pageif __name__ == '__main__':
page = sample_page()
print page.render()