๐ Convert multiple images into a single PDF (f.e. many pages scanned in PNG format)
๐ผ๏ธ Supports PNG, JPG, JPEG, BMP, TIFF, WEBP
โก Natural filename sorting (1.png, 2.png, 10.png)
โ
Transparency-safe: flattens images with alpha channels
๐ ๏ธ Simple CLI interface with customizable options
python make_pdf.py test_files -o output.pdfpython make_pdf.py test_files -o mydoc.pdf --extensions .png,.jpgimage2pdf/
โโโ make_pdf.py # Main CLI script
โโโ helpers.py # Helper functions (sorting, loading, saving)
โโโ test_files/ # Your input images (not tracked in git)
โโโ requirements.txt
โโโ .gitignore
โโโ README.md
.png.jpg/.jpeg.bmp.tiff.webp
- Natural sort (no more
1, 10, 2confusion) - Flatten transparency โ ensures clean white background in PDF
- Skips corrupted/unreadable images with a warning
- Keeps the PDF small and lightweight
pip install -r requirements.txtInput folder (test_files/):
Image (1).png
Image (2).png
Image (10).png
Command:
python make_pdf.py test_files -o my_album.pdfOutput:
โ PDF created: my_album.pdf
Pages: 3
Included (in order):
- Image (1).png
- Image (2).png
- Image (10).png