Created
August 1, 2017 14:15
-
-
Save eruffaldi/399f8b9f990dcab6ac57a4757dbb72cf to your computer and use it in GitHub Desktop.
pdf add 1 blank
This file contains 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
from PyPDF2 import PdfFileWriter, PdfFileReader | |
import sys | |
in1,out = sys.argv[1:] | |
output = PdfFileWriter() | |
input1 = PdfFileReader(file(in1, "rb")) | |
for i in range(0,input1.getNumPages()): | |
p1 = input1.getPage(i) | |
output.addPage(p1) | |
output.addBlankPage() | |
# finally, write "output" to document-output.pdf | |
outputStream = file(out, "wb") | |
output.write(outputStream) | |
outputStream.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment