Convert images (PNG, JPG, etc.) to PDF easily with Python!
Install the required package:
pip install img2pdf
Run this command in your terminal or command line (also works in Jupyter Notebook).
Run the script:
python Script.py
You’ll see your converted PDF in your specified directory.
.png
, .jpg
, etc.img = "C:\\Users\\Strendev\\Strendev.png"
pdf = "C:\\Users\\Strendev\\Strendev.pdf"
\\
) in Windows paths to avoid errors.username.pdf
).Feel free to update or add more details as needed!