Skip to content

Instantly share code, notes, and snippets.

@sergiolucero
Created July 24, 2022 22:31
Show Gist options
  • Save sergiolucero/83c2d50264a26362dcaf1eefdb89fc4c to your computer and use it in GitHub Desktop.
Save sergiolucero/83c2d50264a26362dcaf1eefdb89fc4c to your computer and use it in GitHub Desktop.
concatenate and merge a list of PDF files
import glob
from PyPDF2 import PdfFileMerger
merger = PdfFileMerger()
for fn in glob.glob('*.pdf'):
merger.append(fn)
merger.write('result.pdf')
merger.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment