Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to convert png to pdf with python

from PIL import Image

image_1 = Image.open(r'C:UsersRonDesktopTestview_1.png')
image_2 = Image.open(r'C:UsersRonDesktopTestview_2.png')
image_3 = Image.open(r'C:UsersRonDesktopTestview_3.png')
image_4 = Image.open(r'C:UsersRonDesktopTestview_4.png')

im_1 = image_1.convert('RGB')
im_2 = image_2.convert('RGB')
im_3 = image_3.convert('RGB')
im_4 = image_4.convert('RGB')

image_list = [im_2, im_3, im_4]

im_1.save(r'C:UsersRonDesktopTestmy_images.pdf', save_all=True, append_images=image_list[1:)
Source by datatofish.com #
 
PREVIOUS NEXT
Tagged: #convert #png #pdf #python
ADD COMMENT
Topic
Name
3+8 =