Created
December 29, 2019 07:16
-
-
Save e96031413/4b31eb1195b7904cd72c08fdfa8cbbfe to your computer and use it in GitHub Desktop.
Merge all your jpg files into a single PDF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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