Skip to content

Instantly share code, notes, and snippets.

@quantumchuckles
Last active September 9, 2021 18:07
Show Gist options
  • Select an option

  • Save quantumchuckles/10de757dc1ffc413c6d4b437ef83ac1f to your computer and use it in GitHub Desktop.

Select an option

Save quantumchuckles/10de757dc1ffc413c6d4b437ef83ac1f to your computer and use it in GitHub Desktop.
combine multiple pdf into a single pdf
import sys
from PyPDF2 import PdfFileMerger
inputs = sys.argv[1:]
def pdf_combiner(pdf_list):
merger = PdfFileMerger()
for pdf in pdf_list:
print(pdf)
merger.append(pdf)
merger.write('combined.pdf')
pdf_combiner(inputs)
@quantumchuckles

Copy link
Copy Markdown
Author

python3 pdf_combiner.py <name.pdf> <name2.pdf> .....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment