This Python script converts multiple images into a single PDF file, inspired by img2pdf.
Unlike the img2pdf
library, pic2pdf
is primarily focused on converting images within a given directory or a single image file. The code is simpler compared to img2pdf
, but the optimization of the conversion process might not be as advanced, potentially resulting in slower processing times.
The script uses the Python libraries Pillow and pikepdf to do the conversion.
- Convert multiple images within a specified directory into a single PDF file.
- Simpler code compared to
img2pdf
.
To use pic2pdf
, simply execute the script and provide the input file path or directory path containing the images. Optionally, you can also specify the output PDF file path. If not specified, the output file name will be generated based on the input file or directory name.
$ python pic2pdf.py input_directory -o output.pdf