Created
May 27, 2018 07:17
-
-
Save rounakdatta/3a0d3964e5696610d7a0ae3b466856c0 to your computer and use it in GitHub Desktop.
Quickly merge PDF 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
from PyPDF2 import PdfFileMerger | |
pdfs = ['one.pdf', 'two.pdf'] | |
merger = PdfFileMerger() | |
for pdf in pdfs: | |
merger.append(open(pdf, 'rb')) | |
with open('final.pdf', 'wb') as fout: | |
merger.write(fout) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment