Hi ππ
In this post, I will share with you how to convert images to PDF files using Python.
step 1
You need to install Pillow liblary from here pip install Pillow
step 2
You need to some images to convert them to PDF file
step 3
Load all images and convert them.
from PIL import Image
from os import listdir
def images_to_pdf():
images = [Image.open(f'images/{i}') for i in listdir('images')]
images[0].save('out.pdf', save_all=True, append_images = images)
images_to_pdf()
Now we're done π€
Don't forget to like and follow π
Support me on PayPal π€
https://www.paypal.com/paypalme/amr396
Top comments (5)
I want convert pdf to image. Have any way to do that? (I try with pdf2image, wand. It's success. But they seem have problem with license.
levelup.gitconnected.com/4-python-...
Hic, I cannot access your link.
youtube.com/watch?v=YjyLk4zLils
products.aspose.com/words/python-n...