The Image To PDF Maker is a Python script that allows users to convert a collection of images into a PDF document with a simple and user-friendly graphical interface. The script utilizes the Tkinter library to create the graphical user interface (GUI) and the img2pdf library for the image to PDF conversion.
-
Testing Text File:
- This option creates a text file named "img_files.txt" containing the list of image files sorted numerically by their filenames. It is useful for testing and verifying the correct sorting of images before converting them into a PDF.
-
PDF Conversion:
- This option converts the images into a PDF document with adjustable DPI (dots per inch) settings for different output qualities. The user can select from three DPI options: Screen (72 DPI), Ebook (150 DPI), and Prepress (300 DPI). Higher DPI values result in higher quality PDFs with larger file sizes.
-
Normal Conversion:
- This option performs a standard conversion of the images into a PDF document without any DPI options. Images are sorted naturally by filename (using a custom sort key function) and then converted into a PDF at a fixed DPI of 300.
- Python 3.x
- img2pdf library (
pip install img2pdf
)
- Run the Python script
image_to_pdf_maker.py
. - A window with the Image To PDF Maker GUI will appear.
- Select the image directory by clicking the "Select Image Directory" button. The chosen directory will be displayed below.
- Enter the image extension (e.g., ".png", ".jpg") in the entry field. This extension will be used to filter the images in the selected directory for conversion.
- Choose the desired conversion option by selecting the corresponding radio button:
- "Testing Text File": This will create a text file containing the sorted list of image filenames.
- "PDF Conversion": This will convert the images into a PDF document with selectable DPI options.
- "Normal Conversion": This will convert the images into a PDF document using the default DPI of 300.
- If you select "PDF Conversion," you can further choose the DPI option (Screen, Ebook, or Prepress) from the nested radio buttons.
- Click the "Convert" button to start the conversion process.
- If you choose "Testing Text File" or "Normal Conversion," a file dialog will prompt you to select the destination where the converted PDF will be saved.
- If you choose "PDF Conversion," a file dialog will prompt you to select the DPI option, and then another file dialog will prompt you to select the destination for the converted PDF.
- After successful conversion, a message box will display the result ("Files stored in img_files.txt" or "Images converted to PDF successfully").
- If any errors or issues occur during the conversion process, warning message boxes will appear to notify you.
This project is licensed under the MIT License.
Contributions to this project are welcome. If you find any issues or have improvements to suggest, feel free to open a pull request or submit an issue.
For any questions or inquiries, you can contact the project maintainer at email@proton.me.