Conversion from jpg to Pdf

@Vivek_Sharma

You can use “Invoke Code” in OpenRPA and can use a python script to convert the file.
You can use the Python Imaging Library (PIL) to convert a JPG image to PDF format. Here’s an example code snippet:

from PIL import Image

img = Image.open('image.jpg')
pdf_path = 'image.pdf'

img.save(pdf_path, 'PDF', resolution=100.0)

You can put the “Invoke Code” inside a loop where you can pass a variable with path and filename to it… them save it in a folder.

Note that:

  1. You can also specify the resolution of the output PDF file (100 dpi in this example) using the resolution parameter. This parameter is optional and can be omitted if you don’t need to specify a specific resolution.

  2. Make sure to install the required libraries by running pip install Pillow in your command prompt or terminal before running the code above.

  3. Don’t forget to install “Pillow” it if needed.

I hope this helpes you… if you need any help just let me know.

1 Like