Power Community

Power Community

Webpage-to-PDF with Power Automate Desktop!

One of the key features of Power Automate Desktop is having the ability to work with webpage content.  Common requests include the ability to create a pdf out of a webpage because maybe every end-user doesn’t have access or a license, but you still need to send out a summary or a copy of a page.  In today’s age, it is very common to have a 3rd party system create reports that only a licensed user can see.  Power automate can help and reproduce a webpage as a pdf in only 4 steps!

Step #1:  download Google Chrome Canary here: Chrome Canary Features For Developers – Google Chrome

canary1.png

Step #2: open up Canary and get through all the welcome screens and then closeClosing is important!  Next find canary and open the file location.

canary2.png

Step #3:  You want to copy the target path.  Then we will head over to Power Automate Desktop.

canary3.png

Step #4: In Power Automate Desktop, we will create a quick 4 step desktop flow. First, we will open a CMD session.  Next, we use write to CMD session, add a delay, then close the CMD session.

headless1.png

The command is in this format:

In quotes, we paste in our target for the canary application followed by –headless=new

Next, we add –print-to-pdf=”C:Users*****Downloadsfilename.pdf” or any place you want to create the file.  Of course, the file naming convention can use dynamic content or variables, it’s always your choice!

Lastly, we add the URL of the webpage we want to capture.  So, in this example we create a pdf out of the homepage of the Power Automate Community Forums.

"C:UsersthomaAppDataLocalGoogleChrome SxSApplicationchrome.exe" --headless=new --print-to-pdf="C:UsersthomaDownloadsgheadless_test.pdf" https://powerusers.microsoft.com/t5/Microsoft-Power-Automate/ct-p/MPACommunity

And that’s it!  Just 4 steps!  Here’s a more valid use case to consider, imagine you have about 100 shipping reports you need to get out of a 3rd party system every night using your admin login and you want to create a pdf for each report, then save them to SharePoint to share with your team, upload them somewhere, and/or send them to others by email.  With this scenario, you can easily feed your desktop flow a list of URLs and loop through them in the middle of the night, creating your pdf copies of your shipping reports.

Give Google headless a try for your next webpage-to-pdf automation project!  

My name is Thomas Rice, aka trice602. If you have worked with me before, you know my tagline is…. “Always glad to help! Tom”

LinkedIn: Thomas Rice, PMP | LinkedIn

trice602_1-1711598437773.png

This post was originally published on this site

- Advertisement -spot_img

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement - Advertisement

Latest News

5 Benefits of In-App Notifications for Microsoft Dynamics 365 CRM users

For a successful sales process, you need to stay up-to-date with crucial sales information like deal closures, opportunities won,...

More Articles Like This

- Advertisement -spot_img