Merging multiple pdf files in a folder

Using studio X how to merge pdf files at time in multiple sub folders

Pls help on this.
@studioX
@uipath

1 Like

Hi

Hope the below steps would help you resolve this

  1. Go to design tab → manage packages-> all packages → search for UiPath.PDF
    And install that package

  2. In that we have a activity called JOIN PDF FILES

Where mention the file list property like this

Directory.GetFiles(“yourfolderpath”, “*.pdf”, SearchOptions.AllDirectories)

This will get all the pdf files in your folder and it’s subfolders

And mention the output filename as well so that it will join all together

Cheers @rak95561

1 Like

Hi @rak95561

Were you able to join the pdfs

Hi,

Studio X is don’t have in built feasibility to merge PDF’s. As suggested by palaniyappan you have to go with UiPath PDF activities. if you are citizen developer and you think suggested solution is little complex you can go for Acrobot reader Ui automation to merge PDF but in this case you should have acrobot reader software in your development machine. please follow the steps in the below link how we can merge pdf and re order it by using acrobot reader. thanks. the steps suggested in the below link for acrobot you have to automate by using studiox. this is my thought i hope it would help you to achieve your goal. thanks

Regards,
Kirankumar.

1 Like

Thank you

I tried but getting error the inputfile doesn’t have. Pdf extension.

This should be working
Fine

Make sure your file has a file extension of .pdf

And this expression will any how pick only the the pdf files from all the folders and it’s sub folders

To explain the expression in a simple way
Directory.GetFiles - will get all the file from mention folder path

*.pdf - will get only the pdf files from the folder path

SearchOptions.AllDirectories - it will ensure all the pdf files from folders and it’s subfolders will be fetched

That’s it

Hope this clarifies

Cheers @

1 Like

Thanks you.

It’s working now.

It’s merging all the pdf in sub folders.

I need merging files separately based on sub folders.

Is that possible.

1 Like

Fine
In that case use the below steps if you want to process the files only in sub folders

  1. Use a assign activity like this

arr1 = Directory.GetFiles(“your folderpath”, “*.pdf”)

Where arr1 is a array of string variable

  1. Another assign activity like this

arr2 = Directory.GetFiles(“your folderpath”, “*.pdf”, SearchOption.AllDirectories)

Where arr2 is a array of string variable

  1. Now use a final assign activity like this

Final_arr = arr2.Except(arr1).ToArray()

This will give the pdf only inside the sub folders

Where Final_arr is a array of string variable

Cheers @rak95561

Hi @rak95561,

I see you have an exact duplicate of this question here : PDF Mearging in studio x - #5 by Palaniyappan

Please do not post a duplicate of a same question. This is not best practice in any forum. I can assure asking the same question with two different titles will not get you a solution any faster.

If you want more members to help you you can just write a new post in the thread that way the latest feed gets updated to all members and you may get someone attention who knows the answer.

Ask once and follow up on the same thread and you will see more members interact in any discourse forum be it UiPath or others.

1 Like

A post was merged into an existing topic: PDF Mearging in studio x