Skip to content

Instantly share code, notes, and snippets.

@coppolaemilio
Created July 13, 2015 21:39
Show Gist options
  • Select an option

  • Save coppolaemilio/46138b01a5ad24144e54 to your computer and use it in GitHub Desktop.

Select an option

Save coppolaemilio/46138b01a5ad24144e54 to your computer and use it in GitHub Desktop.
Little script to merge all the PDFs in the same folder
from PyPDF2 import PdfFileMerger, PdfFileReader
import glob
merger = PdfFileMerger()
for filename in glob.glob("*.pdf"):
merger.append(PdfFileReader(file(filename, 'rb')))
merger.write("document-output.pdf")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment