Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.