Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython

pdfsplit is unavailable in PyPM, because there aren't any builds for it in the package repositories. Click the linked icons to find out why.

 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.4.2 Failed View build log
Windows (64-bit)
0.4.2 Failed View build log
Mac OS X (10.5+)
0.4.2 Failed View build log
Linux (32-bit)
0.4.2 Failed View build log
Linux (64-bit)
0.4.2 Failed View build log
 
Links
Author
License
GPL 3
Dependencies
Lastest release
version 0.4.2 on Jan 5th, 2011

Pdfsplit (formally named pdfslice) is a Python command-line tool and module for splitting and rearranging pages of a PDF document. Using it you can pick single pages or ranges of pages from a PDF document and store them in a new PDF document. To do this you describe these pages with the simple Python slice notation, e.g. 0:10 for the first ten pages, -10:0 for the last ten pages, 0::2 for all even pages, -1::-1 for all pages in reversed order, etc.

Basically, pdfsplit wrapps pyPdf, a package written by Mathieu Fenniak which contains the needed functionality in its core, but does not provide a simple method of using it easily from the command-line or from a Python module.

Features

  • save arbitrary slices of a given PDF document in a new PDF document
  • install a Python module named pdfsplit.py
  • install a Python command-line script named pdfsplit
  • specify arbitrary slices using Python notation, e.g. 0:10:2
  • specify pages using normal page numbers (starting at 1), e.g. -p 1-5
  • allow patterns for output files
  • provide a Unittest test suite

Examples

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

>>> from pdfsplit import splitPages
>>>
>>> splitPages("file.pdf", [slice(0, 1, None)])    # i.e. [0]

System Message: ERROR/3 (<string>, line 36)

Inconsistent literal block quoting.

written: file-split.pdf >>> splitPages("file.pdf", [slice(None, None, 2)]) # i.e. [::2] written: file-split.pdf

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

$ pdfsplit 0 file.pdf

System Message: ERROR/3 (<string>, line 45)

Inconsistent literal block quoting.

written: file-split.pdf $ pdfsplit ::2 file.pdf written: file-split.pdf $ pdfsplit -p -o "%(dirname)s/%(base)s-p%(indices)s%(ext)s" 3-5 file.pdf written: file-p3-5.pdf

Subscribe to package updates

Last updated Jan 5th, 2011

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.