Created
April 17, 2021 14:03
-
-
Save NbtKmy/4fcb065eda1d0db4f921cd0abe1a0ef6 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
#!/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