Add a grid on top of all pages of a PDF document.
Project description
Pdfgrid is a Python command-line tool and module for adding a regular grid on top of all pages of an existing PDF document. It will mostly be used for measuring individual parts of PDF pages like graphics or paragraph widths. For the time being, only a rectangular grid with major and minor lines is supported, and their colour and line widths can be set individually.
NOTE: This is an initial release. The API is likely to change and for the time being the grid size is limited to A4, but this will change in future releases.
Pdfgrid depends on two Open Source libraries, namely pyPdf, a package written by Mathieu Fenniak and reportlab by ReportLab, Ltd.
This version fixes an issue with the manual installation.
Features
add regular rectangular grid over all pages of a PDF document
define grid origin on all PDF pages
define grid styles containing grid step, line width and colour
use multiple grids at once with different styling
install a Python module named pdfgrid.py
install a Python command-line script named pdfgrid
provide a Unittest test suite
Examples
You can use pdfgrid as a Python module e.g. like in the following interactive Python session:
>>> from reportlab.lib.colors import red >>> from reportlab.lib.units import cm >>> from pdfgrid import grid >>> grid("foo.pdf", origin=(0, 0), styles=[(1*cm, 0.1, red)]) written: foo-grid.pdf
In addition there is a script named pdfscript, which can be used from the system command-line e.g. like this:
$ pdfgrid -h $ pdfgrid -v $ pdfgrid --origin "0,0" --styles "1*cm,0.1,colors.red" foo.pdf written: foo-grid.pdf
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file pdfgrid-0.2.0.tar.gz
.
File metadata
- Download URL: pdfgrid-0.2.0.tar.gz
- Upload date:
- Size: 38.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 937bd9b9d20c4f240b09da6c77204fc96fc0ebc13f6b9f3dd8d14339023054a9 |
|
MD5 | 272e7d2df93a71a142c2db2e1bd735d0 |
|
BLAKE2b-256 | e74bec11d40aa55f4d039e799bb8d38f8e5fb06b5534b994cb2bf854a37b94f1 |
File details
Details for the file pdfgrid-0.2.0-py2.6.egg
.
File metadata
- Download URL: pdfgrid-0.2.0-py2.6.egg
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba299ea4743eafc13221c9bd577336f4b4f932f7f45dd959fa7c3afa74f45bf6 |
|
MD5 | 7918f8a7ca656eb594535a142108451f |
|
BLAKE2b-256 | c4a340f0f608c41f5b6a7f312b0e7b4808faab7a5bb4c769692495ff669a6774 |
File details
Details for the file pdfgrid-0.2.0-py2.5.egg
.
File metadata
- Download URL: pdfgrid-0.2.0-py2.5.egg
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ffb93d31a6314ac2c98c3fdfb0f62d3aa1f421b9c8b1e1fcce0449b7b08f10e |
|
MD5 | 75819c12a73ebe10e44116fa7c35af2c |
|
BLAKE2b-256 | 7d80799bfc5cfce8f1c6311118c721209042694caac7c4c540e2f799f9eec27c |