Skip to content

Instantly share code, notes, and snippets.

@NbtKmy
Created April 17, 2021 14:03
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 NbtKmy/4fcb065eda1d0db4f921cd0abe1a0ef6 to your computer and use it in GitHub Desktop.
Save NbtKmy/4fcb065eda1d0db4f921cd0abe1a0ef6 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import os
from PIL import Image
if __name__ == "__main__":
num = 1
for i in os.listdir('./img'):
filename = './img/' + i
img = Image.open(filename)
pdf_filename = i.replace('.png', '') + '_output.pdf'
img.save(pdf_filename, "PDF" ,resolution=100.0, save_all=True)
num +=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment