Created
August 10, 2015 07:52
-
-
Save chocobn69/6defca0abf1892e6bdda to your computer and use it in GitHub Desktop.
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 | |
pdf1=PdfFileReader(open("C:/Users/andy/Documents/temp.pdf")) | |
pdf2=PdfFileReader(open("C:/Users/andy/Documents/temp.pdf")) | |
writer = PdfFileWriter() | |
# add the page to itself | |
for i in range(0,pdf1.getNumPages()): | |
writer.addPage(pdf1.getPage(i)) | |
for i in range(0,pdf2.getNumPages()): | |
writer.addPage(pdf2.getPage(i)) | |
# write to file | |
with file("destination.pdf", "wb") as outfp: | |
writer.write(outfp) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment