12/13/2018 - 11:10 PM

Merge PDF

Use a simple python script to merge a large number of PDF files. I used this to put together like 300 images, in ten seconds

from PyPDF2 import PdfFileMerger
import glob
import os

#%% Do the merge, sorting by date of creation. 
pdfs = glob.glob("*.pdf")

merger = PdfFileMerger()

for pdf in pdfs:
    merger.append(open(pdf, 'rb'))

with open('MERGED_PYTHON_PDF.pdf', 'wb') as fout: