Skip to content

Instantly share code, notes, and snippets.

@greed2411
Created March 10, 2018 17:03
Show Gist options
  • Save greed2411/341b690615f0c78c4b0b6e25de725238 to your computer and use it in GitHub Desktop.
Save greed2411/341b690615f0c78c4b0b6e25de725238 to your computer and use it in GitHub Desktop.
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