Skip to content

Instantly share code, notes, and snippets.

@ReemRashwan
Created September 15, 2021 08:10
Show Gist options
  • Save ReemRashwan/d2414a543b504a18576836c2702ac2c4 to your computer and use it in GitHub Desktop.
Save ReemRashwan/d2414a543b504a18576836c2702ac2c4 to your computer and use it in GitHub Desktop.
# pip install PyPDF2
from PyPDF2 import PdfFileMerger
pdfs = ['file1.pdf', 'file2.pdf']
merger = PdfFileMerger()
for pdf in pdfs:
merger.append(pdf)
merger.write("result.pdf")
merger.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment