By J Suhasini
The main aim of this project is to help any user convert multiple images into a single Portable Document Format (PDF) file.
Description of the project:
The Image to PDF converter has three buttons: Select Images, Select PDF and Convert.
1. Select Images: This button opens a dialog box that allows you to select one or more image files (such as JPG, JPEG and PNG) that you wish to convert into a PDF.
2. Select PDF: By clicking this button a save file dialog will open where you can specify the desired name and location for the resulting PDF file.
3. Convert: When pressed this button triggers the "images_to_pdf" function. It takes the selected images and the chosen name for the PDF file as inputs and converts all the images into one PDF document.
The provided code utilizes the Python Tkinter library to create a Graphical User Interface (GUI) program in Python. Its purpose is to merge images into a PDF document.
The "images_to_pdf" function relies on the PIL library. It starts by opening the image in order to create a PDF with that image as its starting point. Then it proceeds to append all remaining images, onto this PDF document.
The function is also called upon to show a popup indicating success or to display an error message if the conversion fails.
After running the GUI users have the option to interact with the buttons and choose images and a PDF file. They can then convert the images into a PDF document.
Source Code:
Submitted by J Suhasini (Suhasini)
Download packets of source code on Coders Packet
Comments