Converting an Excel file to a PDF file

Hi All,

There are similar questions and answer on the forum as I have. However what I want to know is:
I have the folder with files in different formts: .pdf, .doc, .xls
I want to convert all .doc and .xls into the .pdf and save on the same folder.
I have already managed with .doc as there is a special activity for this “Export to PDF”
I have a problem with .xls any suggestions/advises?

Thank you
Gosia

1 Like

hey Malgorzata ,

use this activity!!

regards
Aditya

1 Like

Hi,
Is that a package that contains specific activity? I can not find this package in my UiPath?
THX

yes, you need to install from package manager under All tab

regards
Aditya

This seems to weird.
I do not have this package


I wonder what is your version of UiPath, I have Studio 2018.1.3

THX

it’s 18.2.1

you can go with send hot key

Alt f e a

commands, first try manually and work around

Because that package is community package and not one that is offered by UiPath - if you know how to write your own Activities, .NET offers a method to convert Excel to PDF, I would suggest writing your own VS downloading from community due to upgrade compatibility.

Your call.

Now I see the case…
I’m not that advance to write my own activity, maybe I should…
@aditya.prakash is that mean you wrote this activity by your own?
What should be done to have the access to Community Packages?

No!! it is developed by someone, are you using community version?

I recently automated this entire thing, using “click” actions to simulate clicking file>print>(select relevant settings)>print etc.

Not sure if this is the best path now that others are mentioning more advanced packages?

you can download latest version

you can try my 2nd approach too, once I did with send hot keys

I have the full studio version with the license. Maybe I will ask someone from UiPath how to access to those packages.
I will try with other advises

yah, that’s better!!
Happy Automation :wink:

If you would like a sample of my code (Print excel to PDF) to use, or compare to yours, please let me know, I’d be happy to share!

Thanks

Hi @Alex_Cross, I’m not sure if this workaround idea will be the best for my case. However if you can share the example of your solution would be great.
THX

XL16_PrintToPDF.xaml (35.8 KB)

Hopefully this makes sense, it’s annotated in places, and actions are renamed, but let me know. Basically it will save the file to a PDF, and check that the file has been created in the directory as desired. It will also check if the file exists and overwrite, creating a log message letting you know it has done so. Also, the file I’m printing to PDF started on page 2, if you want the whole doc printing you should set the in_argument for in_PrintFrom to 1.

Hope this helps/makes sense.

Convert .XLS to PDF.zip (7.8 KB)

I think the solution with send hotkey is pretty fast and is very universe especially when you are working on numbers of files

I must say, I do like your hotkey approach, not sure it would have worked for me as I needed to be more specific (ie print from page 2 etc) but otherwise yes.

I had a previous invoke open the file and perform an action, so my component is only for printing to PDF then closing the file.