Skip to content

Instantly share code, notes, and snippets.

@NbtKmy
Last active April 16, 2021 13:53
Show Gist options
  • Save NbtKmy/fe4d8cbac88571a73790f2f2426cd08e to your computer and use it in GitHub Desktop.
Save NbtKmy/fe4d8cbac88571a73790f2f2426cd08e to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import os
from PIL import Image
if __name__ == "__main__":
im_list = []
for i in os.listdir('./img'):
filename = './img/' + i
imgs = Image.open(filename)
im_list.append(imgs)
pdf1_filename = "output.pdf"
im_list[0].save(pdf1_filename, "PDF" ,resolution=100.0, save_all=True, append_images=im_list[1:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment