A lightweight, robust tool to automatically merge a folder of images into a single, high-quality PDF file. π
- π’ Natural Sorting: Smartly handles page numbers (e.g., sorts
Page 2beforePage 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.
Before running the tool, ensure you have the following ready:
- Python 3.x installed on your system.
- Pillow (PIL) library for image processing.
-
Open your terminal or command prompt (cmd).
-
Install the required image library by running:
pip install Pillow
Follow these simple steps to create your PDF:
-
π Place the Script Copy the
image_to_pdf.pyfile into the folder containing your images. -
π Run the Converter Open your terminal in that folder and run:
python image_to_pdf.py
-
β Done! The script will detect your images, sort them, and generate a PDF file named after the folder (e.g.,
MyChapter.pdf).
The tool automatically detects the following file types:
- β
.jpg/.jpeg - β
.png - β
.bmp - β
.tiff
| 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.