Image to PDF Conversion Python Script
$0+
$0+
https://schema.org/InStock
usd
LearnGPT.today
Image to PDF conversion script with support for additional image formats:
Description: This Python script converts all supported image files in a source folder into a single PDF document. It sorts the images alphabetically by filename before conversion.
Supported image formats are:
- JPEG (.jpg, .jpeg)
- PNG (.png)
- BMP (.bmp)
Instructions:
- Install required Python modules:
<!---->
pip install pillow img2pdf
2. Add image files to convert to the "images" folder:
- Place your JPEG, PNG, and BMP images in the "images" folder located in the same directory as the Python script
- Run the script:
<!---->
python create_pdf.py
4. The output PDF is created in the "pdfs" folder:
- The PDF will be named "images.pdf"
- Images are sorted alphabetically by filename in the PDF
- PDF page size matches the original images
- Adjust source and destination folders:
- Update the
src_folder
anddest_folder
variables if you want to use different folder names - Folders will be created automatically if they don't exist
Usage Tips:
- Works best with images of similar sizes/aspect ratios
- Very large images may result in a large PDF file size
- Supported image types can be adjusted by modifying the script
Size
2.99 KB
Add to wishlist
Share
Ratings
1
5
5 stars
100%
4 stars
0%
3 stars
0%
2 stars
0%
1 star
0%