A powerful command-line tool for converting images to PDF format with advanced features.
- Convert single images to PDF
- Combine multiple images from a folder into a single PDF
- Automatic timestamp in output filenames for unique identification
- Support for various image formats (JPEG, PNG, BMP, TIFF, GIF)
- Automatic RGB color space conversion
- Smart file ordering when combining multiple images
- Clone this repository:
git clone https://github.com/yourusername/PDFForge.git
cd PDFForge- Install the required dependencies:
pip install -r requirements.txtBasic usage:
python img_to_pdf.py -i path/to/image.jpgThis will create a PDF with a timestamp in the name (e.g., image_20250123_152351.pdf)
Specify output file:
python img_to_pdf.py -i path/to/image.jpg -o output.pdfConvert all images in a folder:
python img_to_pdf.py -f path/to/folderThis will create a combined PDF with a timestamp (e.g., combined_foldername_20250123_152351.pdf)
Specify output for combined PDF:
python img_to_pdf.py -f path/to/folder -o combined_output.pdf- JPEG/JPG
- PNG
- BMP
- TIFF
- GIF
python -m unittest test_img_to_pdf.py -vThis project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.