Skip to content

Instantly share code, notes, and snippets.

@e96031413
Created December 29, 2019 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e96031413/4b31eb1195b7904cd72c08fdfa8cbbfe to your computer and use it in GitHub Desktop.
Save e96031413/4b31eb1195b7904cd72c08fdfa8cbbfe to your computer and use it in GitHub Desktop.
Merge all your jpg files into a single PDF
import img2pdf
import os
current_path = os.getcwd()
with open("output.pdf", "wb") as f:
f.write(img2pdf.convert([i for i in os.listdir(current_path) if i.endswith(".jpg")]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment