Automate Update of pdf

Hello all, i will really appreciate if some one can help out in creating a project that will:

  1. open a master folder
  2. go through each and every sub-folder in that master folder and find pdf document if there is no pdf in that folder then move to next sub-folder and do the same
  3. once pdf document exist, i want the tool to be able to open ever pdf document and apply enhance filter on the pdf so that the pdf document is searchable

I will be very very thankful if someone could help out/suggest/guide in this task

Hi @Saad_rehman,

Step1:files=Directory.getfolder(files)
Step2:Loop files
Step3:arString=Directory.getfiles(item)
Step4:loop arString
Step5:if(getextenstion(item)=PDF)
Step6:then use move activity to move pdf to other folder.

Thanks,

@Gouda_6 can you elaborate on each step. sorry if this sounds like too much. i am super new this tool

Hi @Saad_rehman

I have a workflow which I created. It does a search for pdf files in a particular master folder. The result is, it gives all the available file paths of pdf files in sub folders in the master folder to an array. Using this array, you can do anything with the pdf file :slight_smile:

GetFilesInFolders.xaml (5.9 KB)

I think this is what you need…

Let know whether this helps

If it works, please make sure to mark the answer as the solution too :slight_smile:

1 Like

Lahiru thank you for this. it does loops through each file but i want the package to also perform enhance activity on each pdf file. do you know of any such activity available?

1 Like

Hi @Saad_rehman

Glad to hear that my solution works…

About the enhancing, im not sure whether such activity exists. However we can have a desktop automation to perform those actions in the acrobat pdf itself. we can use the start process or open application activity to open the pdf file. Then Just clicking and navigating to those options toget it enabled through desktop automation…

Hope it helps and let know how it goes for you

Lahiru, with the open application activity how is it possible to add one activity that will loop through all the files in the sub folder? or i will have to create individual activity for every file that is located in the sub folder?

HI @Saad_rehman

You get the file list to a array right? So you can use that array and loop through each file. The array will have the file path, so we can easily have the open application activity with a For Each loop and provide the file path there. Everything here should be done within the For Each loop starting from the open application activity…

Get the idea?

what i understand from what you are saying is that in the open application activity use MasterfolderPath variable and use in the Arguments and Filename fields? is this what you are trying to say?

Yes… So in our above posts, we were able to extract all the files that contain the pdf extension into an array right. So you give the master folder path, and it gives a list of all files in that along with the subfolders. So basically, it returns an array of files right.

So we can use a For Each Loop, to loop through the file list array.
Within the loop, have the open application activity. And for the path, we give the item from the the array.

For Each Item of FilePathArray
     Open Application - item.ToString (item contains the file path for current file)
     [Have your other activities to do the rest of the stuff once the pdf opens in the background]
End loop

so you are saying that instead of using open application activity inside first foreach loop use another foreach loop and then use open application activity inside the recent created for each loop?

Capture

here is the screen shot of what i am trying to do. The process runs smooth but the send hotkey task is not implemented. I am not sure what i am doing wrong here

Oh no… that’s not what I meant… Just follow the below steps

  1. Get the list of files to an array just like what we discussed.
  2. Loop the array using For Each activity
  3. Within the loop, Open application activity and all the other related steps

So, only one for each loop bro… Im sorry If I mislead you in somewhere…

Just one for each loop, and within the loop, open application activity.

Hope this helps to clear it out?

No problem. That is how i was doing it earlier. My question is what will i add in the open application properties pane. for example what selectors will i use that will loop through all of the files in the sub-folders

For the properties of open application, use the file path that you get from the For Each Loop. The Item variable contains the file path. You can use that in you open application/ Start process activities