Raks_K
(Raks K)
1
I want to Merge 2 PDF files. 1 PDF contain 1st page of details and 2nd PDF contains other details.
Can somebody please help.
I have a plan but not sure if it will work.
In an excel I can give 1st file path & second file path But need a way to build a loop around it.
Ajay_Mishra
(Ajay Mahendra Mishra)
2
Hey @Raks_K
Goto Manage Package Add → below mentioned package with same version

Then in Activity Panel–> Search for Merge PDF → Drag it to Designer Canvas → It will automatically add one more package →

Then → Add Two PDFs using Add Entry button.
Screenshot for your reference:
If you want to add Pdf’s path dynamically then,
Click on Use Collection of Pdf Files,
Then,
Put below mentioned Query:
Directory.GetFiles("Your\Folder\Path","*.pdf").Select(Function(x) LocalResource.FromPath(x.ToString)).ToArray
Note: Replace Your\Folder\Path in the above query with the source folder path which has pdfs in it!
Screenshot of Variable panel for your reference:
Or
Refer this
Hope all the above-mentioned information will help you!
If Yes, then kindly mark this post as a Solution.
Happy Automation!
Regards,
Ajay Mishra
Raks_K
(Raks K)
3
One PDF is in one folder, another PDF is in another folder.
I want the bot to pick the first pdf & pick the right pdf from second folder & then Merge
Raks_K
(Raks K)
4
@ashokkarale can you please advise?
Ajay_Mishra
(Ajay Mahendra Mishra)
5
@Raks_K
Okay so you have 2 folders then use below mentioned query in my above solution:
{LocalResource.FromPath(Directory.GetFiles("Your\1stFolder\Path","*.pdf").First),LocalResource.FromPath(Directory.GetFiles("Your\2ndFolder\Path","*.pdf").First)}
If you want to join only to pdfs then use above query.
And If you want to join multiple pdfs from two different folders:
Directory.GetFiles("Your\1stFolder\Path","*.pdf").Select(Function(x) LocalResource.FromPath(x.ToString)).ToArray.Concate(Directory.GetFiles("Your\2ndFolder\Path","*.pdf").Select(Function(x) LocalResource.FromPath(x.ToString)).ToArray).ToArray
Note: Replace Your\Folder\Path in the above query with the source folder path which has pdfs in it!
Regards,
Ajay Mishra
Raks_K
(Raks K)
8
It is not merging as it should
lrtetala
(Lakshman Reddy)
9
@Raks_K
It creates a new file and adds that 2 files into it.
Cheers!!
Ajay_Mishra
(Ajay Mahendra Mishra)
10
@Raks_K
Hey,
You have passed it in Double quotes, why so?
And also it’s better to show the error message.
I didn’t passed any quotes here:
Regards,
Ajay Mishra