This utility provides a simple CLI to convert images to PDF.
- Python 3.10+
- Pillow (
pip install pillow)
Convert all images in File_Handler/pre_conv to PDFs in File_Handler/post_conv (defaults):
python File_Handler/pre_conv/converter.py --input-type image --output-type pdfConvert all images in a specific folder to individual PDFs:
python File_Handler/pre_conv/converter.py File_Handler/pre_conv/sample_images --input-type image --output-type pdfMerge multiple images into a single PDF (written to File_Handler/post_conv/merged.pdf by default):
python File_Handler/pre_conv/converter.py File_Handler/pre_conv/sample_images --input-type image --output-type pdf --mergeConvert a single image to PDF:
python File_Handler/pre_conv/converter.py File_Handler/pre_conv/sample_images/example.jpg --output File_Handler/post_conv- If
--outputpoints to a directory, PDFs are written inside it. - If
--outputis omitted, files are written toFile_Handler/post_conv. - If
--mergeis used without a filename, output defaults toFile_Handler/post_conv/merged.pdf.