Tuesday, 30 August 2022

Day 95 : Images To PDF conversion using Python

 

from PIL import Image


def Images_Pdf(filename, output):

    images = []


    for file in filename:

        im = Image.open(file)

        im = im.convert('RGB')

        images.append(im)

    

        images[0].save(output, save_all=True, append_images=images[1:])


        #clcoding.com


# Images Path , output pdf

Images_Pdf(["binod_mirror.png", "binod.png", "binod.jpg"], "output.pdf") 


0 Comments:

Post a Comment

Codecademy Code Foundations

Popular Posts

Categories

Android (23) AngularJS (1) Assembly Language (2) Books (10) C (75) C# (12) C++ (81) Course (1) Data Strucures (4) Downloads (1) Engineering (13) flutter (1) FPL (17) Hadoop (1) HTML&CSS (38) IS (25) Java (89) Leet Code (4) Pandas (1) PHP (20) Projects (19) Python (397) R (69) Selenium Webdriver (2) Software (14) SQL (27)