How to Save Webpage as PDF from URL and Upload to Storage Bucket [Studio Web]

I am using UiPath Studio Web and have successfully read data from a SharePoint list. One column contains multiple webpage URLs.

Now I need to:

  1. Open each URL
  2. Save the webpage as a PDF
  3. Upload the PDF to a Storage Bucket

Since browser automation isn’t supported in Studio Web, can anyone suggest a way to convert webpages to PDF workaround that works in cloud?

Hi,
Browser automation is supported in Studio Web via the UIA Activities present in Studio Web. I am to sure why you are saying it is not supported.

Ohh, sorry! I mistakenly mentioned that browser automation isn’t supported thanks for correcting me.

That said, is there a way in Studio Web to save a webpage as a PDF and then upload it to a Storage Bucket? Any activity or recommended approach for that would really help.

Thanks again!

You can try Ctrl + P on web page or Print option via browser setting menu.
New popup will appear to Print. Select destination as Save as PDF. This should popup File save dialog where you can save the PDF and upload it to storage bucket.

Let us know if this works in Studio Web

@Vinit_Mhatre

If you have adobe license then adobe has an activity which can generate pdf using url

Edit → Note: This generates from the file of offcie 365 type so ideally plain url would not support for this

Cheers

You can generate a PDF using Chrome (or Edge) without any UI automation.

This is how to do it with Chrome. Edge would be similar but different syntax.

Use the Start Process activity. Set FileName to the path of your Chrome executable ie:

"C:\Program Files\Google\Chrome\Application\chrome.exe"

Set Arguments to this:

"--headless=new --disable-gpu --print-to-pdf=""" + DestinationFilePathAndName + """ """ + URLofWebPage + """"

Put this inside a Wait For Download, of course, so your automation will not continue until the file is created.

1 Like

@adi.mehare I tried this method, but in Studio Web, I’m not able to open the print popup by pressing Ctrl+P on the opened page. I also tried using the Click activity, but it can only indicate elements on the page not the browser-level elements like the print dialog.

@Anil_G don’t have a license for Adobe. Is there any other way to achieve this?

@postwick Thank you for this, but i want to do this process in UiPath studio web

Why can’t you do it in Studio Web? Chrome is available, right?

@postwick

in cross platform it can run on linux and all as well so no path of chrome not a start process works similar

@Vinit_Mhatre

you can try with invoke code https://stackoverflow.com/questions/564650/convert-html-to-pdf-in-net ..never tested it…but if you open studioweb on studio it still will be cross platform and you should be able to install the related packages

cheers

@Anil_G

Yes I have a licence of Adobe and using adobe activities to convert web URL into pdfs, but that activities throws an error.

Would you please suggest me some methods or steps using adobe activities will be more helpful.

Thanks!