prashantP
(prashantP)
1
Hi guys,
I Have one scenario where I am merging multiple PDF files into one PDF file.
Multiple files

into One File

now, robot should check if “New.pdf” file is
less than 5mb then
“process further”
Else
“split file”
I am stuck at Else block “Split File”
Kindly suggest…!
@Palaniyappan
@sarathi125
@AshwinS2
prashantP
(prashantP)
4
Thanks
@AshwinS2
@kadiravan_kalidoss
This is quite confusing. Lets say if split into ranges 1-4,…40-45.
what if 1-4 file size is greater than 5mb ?
I think this will not work in my case. because now there is possibility to have more than 50+ files.
is there any way to check length of files and then join accordingly ?
Thanks
@sarathi125
sarathi125
(Parthasarathi)
5
@prashantP,
While merging pdf files get the pdf files which are all has total size below 5MB then merge those alone
prashantP
(prashantP)
6
@sarathi125
there you are.!!
What I need to do for same ??
could you please elaborate more ?
prashantP
(prashantP)
7
sarathi125
(Parthasarathi)
8
@prashantP,
Check this xaml, Used linq query inside invoke code.
It will return List(Of List(Of Fileinfo)), so you can merger the files by lists
SplitFilesBasedOnSize.xaml (9.4 KB)
1 Like
prashantP
(prashantP)
9
Hi @sarathi125
I just folder path to “strDesktop” variable
and getting below output.

@Palaniyappan
@HareeshMR
sarathi125
(Parthasarathi)
10
@prashantP,
Then I think those 6 PDFs files total size may be less than 5MB and those are only the files in that directory?
1 Like
prashantP
(prashantP)
11
@sarathi125
now I inserted 20mb pdf file in same location

so it is grouping now ?
my next step should be inside body ?
Sorry bro but honestly I am not getting it.
kindly advise.
Thanks @sarathi125
sarathi125
(Parthasarathi)
12
@prashantP,
Yes, In the Inner For Each loop you need to merge the list of files available in that as a PDF.
prashantP
(prashantP)
13
Thanks @sarathi125
This what i did
But output of this is highlighted in red below “new.pdf”

If I am not wrong here we are not calculating sum of file size. Right?
because file name “ef1710en.pdf” size = 4655kb and
I think we need sum of file size and group them and then merge or join group wise into one file ?
Please correct me and suggest me.
Thanks,
@Palaniyappan
@HareeshMR
sarathi125
(Parthasarathi)
14
@prashantP,
The files are grouped into List(Of Fileinfo), so you need to pass that to the Merge PDF activity as shown below.
prashantP
(prashantP)
15
2 Likes
system
(system)
Closed
16
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.