How to Merge multiple images to one pdf file

Hello guys,

@Palaniyappan
@loginerror

@Sreelatha278

I have to convert multiple images into One PDF file. Client is not agree with any third party tool or web site.

I tried to use Image To PDF Converter activity but it selects only one .jpg file.
image

could one any please suggest better solution ??

Thanks

1 Like

Kindly have a view on this thread

Cheers @prashantP

@prashantP,

Check this post, same query.

Saving Screenshot in PDFRPA Developers

Hi, as part of my project, I need to take multiple screenshots in various steps. In the end, all the images need to be added in a Word/PDF file and to be sent across via mail. Please let me know how to add multiple images in a single Word/PDF file.

@prashantP

Use Word Application Scope activity and inside that use Add picture activity to add images into it and then finally use Export to PDF activity to export as PDF document.

https://docs.uipath.com/activities/docs/word-export-to-pdf

1 Like

thanks guys,

@Palaniyappan
@sarathi125
@lakshman

It works Fine.

But still is there any other way around ? (something from uipath itself)

Like “Image To PDF Converter” Activity similar kind

Please suggest !

2 Likes

I think the activity will convert a single image as of now and we can even see in that component reviews
But your scenario is for multiple images

Cheers @prashantP

Thanks @Palaniyappan

Hope so it will come soon with multiple images selection.:slightly_smiling_face:

In the same scenario!
After converting images into PDF. I have to check pdf file size. it should be less than “5000kb” then it can be valid to upload on portal else it should split into two or more.

any suggestion ?
@sarathi125
@lakshman

1 Like

yah
and we can directly zip that pdf to a compressed zip folder
will that be fine for you

@prashantP

1 Like

@Palaniyappan

No, can not upload in zip,rar, or 7zip format.

It should be either pdf or jpg file( if 1 to 4 jpg files then it will upate one by one)
But there is chance to have more than 40-50 images that time all images should merge into pdf then check

file size less than “5000kb”
then
uplod
else
split file

similar kind process need to build.

Hope you got my point.

Thanks,

Hi guys

@Palaniyappan
@sarathi125
@lakshman

waiting for your response ?

@prashantP,

To know the file size you can check that by using FileInfo class.

New FileInfo(FilePath).Length

This will return the file size in a long variable, so you can use that further.

Thanks @sarathi125

It Works.

now regarding merging.

instead of using word application scope.
I will convert each img to pdf and then merge all pdf into one
i have done below

but I am getting an error while passing SourceFiles in " Merge PDF Files " property.

image

@Palaniyappan
@lakshman

kindly suggest.

1 Like

Fine
In the merge pdf file activity the input will be type array of file path
As we have mentioned her with a generic variable it is showing error
So mention the lstOfImageFiles.ToArray as input
Cheers @prashantP

Thanks @Palaniyappan for quick response.

I have also tried the same one but getting below error

type variable of is List should i change it into array of string ??

1 Like

Oh I thought lstOfImageFiles variable is the list file path
Sorry for that
Mention the list of file path variable as input to merge pdf activity

Cheers @prashantP

@Palaniyappan
@sarathi125
@lakshman
could please mention full details about variable type "List of file path " or any snap for reference. because I am not getting it what variable type should I select for “List of file path”

1 Like

Guys,
@Palaniyappan
@sarathi125
@Sreelatha278

Please help.!!

1 Like

yah the type will be for a LIST variable of type STRING
System.Collections.Generic.List(Of string)

Cheers @prashantP

@prashantP,

Create List of String Variable as like the following, In the variables under types click on Browse for more types.

Untitled

1 Like

@prashantP,

use Join PDF files from the latest PDF activities,

1 Like