Skip to content

Instantly share code, notes, and snippets.

@aqzlpm11
Created June 11, 2020 15:11
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 aqzlpm11/f5c25199986681679f5406d5b625f1c0 to your computer and use it in GitHub Desktop.
Save aqzlpm11/f5c25199986681679f5406d5b625f1c0 to your computer and use it in GitHub Desktop.
images to pdf
from PIL import Image
import os
im_list = [Image.open('abc/'+i).convert('RGB') for i in sorted(os.listdir('abc')) if i.endswith(".png")]
im_list[0].save('output.pdf', "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