Skip to content

MarwanArafa/ImageToPDF-Converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“‘ Image to PDF Converter

A lightweight, robust tool to automatically merge a folder of images into a single, high-quality PDF file. πŸš€

✨ Features

  • πŸ”’ Natural Sorting: Smartly handles page numbers (e.g., sorts Page 2 before Page 10).
  • πŸ“‚ Auto-Organization: Automatically names the output PDF based on the parent folder name.
  • πŸ–ΌοΈ Multi-Format Support: Compatible with JPG, PNG, BMP, TIFF, and more.
  • ⚑ Fast & Efficient: Converts files instantly with memory-safe processing.

πŸ› οΈ Prerequisites

Before running the tool, ensure you have the following ready:

  • Python 3.x installed on your system.
  • Pillow (PIL) library for image processing.

βš™οΈ Installation

  1. Open your terminal or command prompt (cmd).

  2. Install the required image library by running:

    pip install Pillow

πŸš€ How to Use

Follow these simple steps to create your PDF:

  1. πŸ“ Place the Script Copy the image_to_pdf.py file into the folder containing your images.

  2. πŸƒ Run the Converter Open your terminal in that folder and run:

    python image_to_pdf.py
  3. βœ… Done! The script will detect your images, sort them, and generate a PDF file named after the folder (e.g., MyChapter.pdf).


πŸ“„ Supported Formats

The tool automatically detects the following file types:

  • βœ… .jpg / .jpeg
  • βœ… .png
  • βœ… .bmp
  • βœ… .tiff

❓ Troubleshooting

Error Message Solution
ModuleNotFoundError: No module named 'PIL' You forgot to install Pillow. Run pip install Pillow.
No images found Make sure the .py file is inside the same folder as your images.
Permission denied Close any open files and try running the script as Administrator.

Made with ❀️ and Python.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages