Created
March 10, 2018 17:03
-
-
Save greed2411/341b690615f0c78c4b0b6e25de725238 to your computer and use it in GitHub Desktop.
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 os | |
import img2pdf | |
# takes all the images in the current working directory and puts as one centered image per page | |
with open("output.pdf", "wb") as f: | |
f.write(img2pdf.convert([i for i in os.listdir(os.getcwd()) if i.endswith(".jpg")])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment