Python Automation Scripts You Should Know -How to convert a single image to a PDF:

PHOTO EMBED

Fri Feb 10 2023 16:50:23 GMT+0000 (Coordinated Universal Time)

Saved by @saimohan35 #python

import os
import img2pdf
with open("output.pdf", "wb") as file:
   file.write(img2pdf.convert([i for i in os.listdir('path to image') if i.endswith(".jpg")]))
content_copyCOPY

https://www.freecodecamp.org/news/python-automation-scripts/