Skip to content

Instantly share code, notes, and snippets.

@RC1140
Created September 16, 2014 17:09
Show Gist options
  • Save RC1140/d0008fab2ed0d01859ef to your computer and use it in GitHub Desktop.
Save RC1140/d0008fab2ed0d01859ef to your computer and use it in GitHub Desktop.
splitDocument.py
from PyPDF2 import PdfFileWriter, PdfFileReader
input1 = PdfFileReader(open("fileToSplit.pdf", "rb"))
for i in range(input1.numPages):
output = PdfFileWriter()
output.addPage(input1.getPage(i))
outputStream = file('review'+i.__str__()+'.pdf', "wb")
output.write(outputStream)
outputStream.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment