Image to PDF Converter is a simple Python application that lets you convert image files (PNG, JPG, JPEG, GIF, BMP) to PDF. It features a clean, user-friendly GUI built with Tkinter, and leverages the Pillow (PIL) library for image handling and PDF generation.
- Image to PDF Conversion β Quickly convert image files into PDFs.
- User-Friendly GUI β Intuitive interface built with Tkinter.
- File Selection Dialog β Easily select image files via a file browser.
- Robust Error Handling β Handles invalid selections and displays descriptive error messages.
- Status Updates β Get real-time feedback during image selection and conversion.
- Python 3.x
- Tkinter (GUI)
- Pillow (PIL)
Ensure you have Python 3 installed and install the Pillow library:
pip install Pillow
- Clone the Repository
git clone https://github.com/AbdullahJaveid/img-to-pdf.git
cd img-to-pdf
- Run the Script
Open a terminal and run:
On Windows:
python main.py
On Mac/Linux:
python3 main.py
- Convert Images to PDF
-
Use the Browse button to select an image.
-
Click Convert to PDF to begin conversion.
-
Upon success, the resulting PDF will open automatically.
tkinter
, filedialog
, messagebox
β GUI and file interaction.
os β Open PDF with default system viewer.
PIL (Pillow) β Image manipulation and PDF saving.
π§© ImageToPDFConverter
Class
__init__()
β Initializes GUI components.
select_image()
β Allows image selection and updates path.
convert()
β Converts selected image to PDF and opens it.
if __name__ == "__main__":
ImageToPDFConverter()
Ensures the application runs only when the script is executed directly.
Contributions are welcome!
-
Fork the repository.
-
Create a new branch.
-
Make your changes.
-
Commit and push.
-
Submit a Pull Request.