1from PIL import Image
2
3image1 = Image.open(r'path where the image is stored\file name.png')
4im1 = image1.convert('RGB')
5im1.save(r'path where the pdf will be stored\new file name.pdf')
6
1from PIL import Image
2
3im1 = Image.open("/Users/apple/Desktop/bbd.jpg")
4im2 = Image.open("/Users/apple/Desktop/bbd1.jpg")
5im3 = Image.open("/Users/apple/Desktop/bbd2.jpg")
6im_list = [im2,im3]
7
8pdf1_filename = "/Users/apple/Desktop/bbd1.pdf"
9
10im1.save(pdf1_filename, "PDF" ,resolution=100.0, save_all=True, append_images=im_list)
11