Created
April 18, 2012 15:04
-
-
Save pomarec/2414175 to your computer and use it in GitHub Desktop.
Takes a pdf in argument and spit all its pages in differents files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# install pyPdf "sudo pip install pyPdf" | |
from pyPdf import PdfFileWriter, PdfFileReader | |
import sys | |
input1 = PdfFileReader(file(sys.argv[1], "rb")) | |
for i in range(input1.getNumPages()): | |
output = PdfFileWriter() | |
output.addPage(input1.getPage(i)) | |
outputStream = file("o" + str(i) + ".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