Skip to main content

Layout multiple pages per sheet of a PDF document.

Project description

Pdfnup is a Python module and command-line tool for layouting multiple pages per sheet of a PDF document. Using it you can take a PDF document and create a new PDF document from it where each page contains a number of minimized pages from the original PDF file.

Right now pdfnup should be used on documents with all pages the same size, and half square page numbers per sheet work best on paper sizes of the ISO A series.

Basically, pdfnup wrapps pyPdf, a package written by Mathieu Fenniak, which does not provide tools like this for using the core functionality easily from the command-line or from a Python module. Pdfnup itself was much inspired from some code written by Henning von Bargen - thanks, Henning!

This release provides full support for file objects and StringIO objects for input as well as output documents and fixes a nasty buglet in the command-line invocation script.

Features

  • save minimized pages of a given PDF document in a new PDF document

  • place n pages per sheet, with n being square or half square

  • customize layout order, both horizontally and vertically

  • turn rotated pages to make them all have the same format

  • allow patterns for output files

  • supports file-like objects for input and output documents

  • install a Python module named pdfnup.py

  • install a Python command-line script named pdfnup

  • provide a Unittest test suite

Examples

You can use pdfnup as a Python module e.g. like in the following interactive Python session:

>>> from pdfnup import generateNup
>>>
>>> generateNup("file.pdf", 8, verbose=True)
written: file-8up.pdf
>>>
>>> generateNup("file.pdf", 8, dirs="LD", verbose=True)
written: file-8up.pdf
>>>
>>> f = open("file.pdf")
>>> generateNup(f, 8, outPathPatternOrFile="out-%(n)dup.pdf", verbose=True)
written: out-8up.pdf

In addition there is a script named pdfnup, which can be used more easily from the system command-line like this (you can see many more examples when typing pdfnup -h on the command-line):

$ pdfnup -V file.pdf
written: file-4up.pdf
$ pdfnup -V -n 8 file.pdf
written: file-8up.pdf
$ pdfnup -V -n 8 -l LD file.pdf
written: file-8up.pdf
$ pdfnup -V -n 9 /path/file[12].pdf
written: /path/file1-9up.pdf
written: /path/file2-9up.pdf
$ pdfnup -V -n 8 -o "%(dirname)s/foo.pdf" /path/file.pdf
written: /path/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

pdfnup-0.4.1.tar.gz (57.1 kB view details)

Uploaded Source

Built Distributions

pdfnup-0.4.1-py2.6.egg (14.2 kB view details)

Uploaded Source

pdfnup-0.4.1-py2.5.egg (14.3 kB view details)

Uploaded Source

File details

Details for the file pdfnup-0.4.1.tar.gz.

File metadata

  • Download URL: pdfnup-0.4.1.tar.gz
  • Upload date:
  • Size: 57.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pdfnup-0.4.1.tar.gz
Algorithm Hash digest
SHA256 72819aa8a40f4fba09ff95bc7a71c9f72d92cdc06cb180a633ae6f12adfc0383
MD5 e9e52b3e6af8696b7e10064efb12ac3c
BLAKE2b-256 0495280c10b87d8b21a60feb2c71686cf7716fd61de6757d08f01a19f95541e3

See more details on using hashes here.

File details

Details for the file pdfnup-0.4.1-py2.6.egg.

File metadata

  • Download URL: pdfnup-0.4.1-py2.6.egg
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pdfnup-0.4.1-py2.6.egg
Algorithm Hash digest
SHA256 91cc9430ff833e32523a7d52d2827af021426f90e84f0a8484ba3a9a65102147
MD5 1e466c1a0fc0563788eee9daa160debb
BLAKE2b-256 deadf7139b6e155bf35da99036bebe008a125a8460a0922dc8e266c56747d839

See more details on using hashes here.

File details

Details for the file pdfnup-0.4.1-py2.5.egg.

File metadata

  • Download URL: pdfnup-0.4.1-py2.5.egg
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pdfnup-0.4.1-py2.5.egg
Algorithm Hash digest
SHA256 2162ec1d92677a5fa27d02229bdab1722162420d4b0df4a59776fc1890ae7208
MD5 bbdabbeb544e9f69d0832fd496fb349f
BLAKE2b-256 749a72cdb159b8099aa1d55c7809f1b1452309f18b9dda566fa7cd8beaf41354

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