Skip to main content

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.

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

Project details


Download files

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

Source Distribution

pdfgrid-0.1.0.tar.gz (38.2 kB view details)

Uploaded Source

Built Distributions

pdfgrid-0.1.0-py2.6.egg (7.6 kB view details)

Uploaded Source

pdfgrid-0.1.0-py2.5.egg (7.6 kB view details)

Uploaded Source

File details

Details for the file pdfgrid-0.1.0.tar.gz.

File metadata

  • Download URL: pdfgrid-0.1.0.tar.gz
  • Upload date:
  • Size: 38.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pdfgrid-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a95d67aee15e9bd2b096850e70dd65ab7d531e91047e078409962401e78b303d
MD5 e7001a2587a3a44935062a46119d07e8
BLAKE2b-256 1b462f8511c5dbe364aff0f856059626bea9dba40d0988a82b7a9a105ebfe7e4

See more details on using hashes here.

File details

Details for the file pdfgrid-0.1.0-py2.6.egg.

File metadata

  • Download URL: pdfgrid-0.1.0-py2.6.egg
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pdfgrid-0.1.0-py2.6.egg
Algorithm Hash digest
SHA256 e40b8830ac01aee4d1f75db2f37d3bb776cc39bab9ce77498f8ba53d5af6eec9
MD5 b45ed9c615bceaacf594690f31453be2
BLAKE2b-256 022c7c483f30f6ad941ddac0935bf6320957b69093a782a3f7062822917e96c1

See more details on using hashes here.

File details

Details for the file pdfgrid-0.1.0-py2.5.egg.

File metadata

  • Download URL: pdfgrid-0.1.0-py2.5.egg
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pdfgrid-0.1.0-py2.5.egg
Algorithm Hash digest
SHA256 390efce4e0b6b366bc722f8d19d8067cb311c24f3780cb1cd434f38bf8974b70
MD5 d56f6361175e37142bb792cdb66b3902
BLAKE2b-256 ae5bea927cf39a2db3de3a01f414a93a3c13b5a2e1d766383ef9779b8c9d8e51

See more details on using hashes here.

Supported by

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