Hello
I have already built a solution using web recorder which takes me to a specific webpage. We need to print to PDF the webpage.
On the page there is a Print button which does this:
javascript:window.print()
The problem is the web recorder does not record anything I do within the standard Chrome print dialog box (e.g. selecting the destination as 'Save as PDF', or actually clicking the blue 'Save' button.
I do not want to screenshot the webpage for formatting reasons.
Also, I would need some advice as to how to handle the actual PDF i.e once the save button is clicked, how to programmatically choose a file name and folder to save it.
I do not mind if the solution is to use another browser (currently using Chrome).
Thank you
I know I'm late to the party but I just had this issue too. What I did was to select Adobe DC as my default viewer to .png. So I save webpage and it saves as png but when I open it, BOOM! PDF
Hi @OXDevUser
- After pressing Ctrl P
- Give a wait stage for the print dialog to open
- Then sendkeys for Enter
This will hit the save button.
Here it is assumed that you already have set the destination to "Save as Pdf"
1) I would use {LControlKey}(p) - Send Keys can read “P” as Shift+p.
2). I don’t think I have tried print to pdf and then had a save button, it’s usually a print button. If there is a save button, try send keys for control + s.
Hope this helps.
@Anonymous / @Anonymous: I'm always getting the error: "Failed to press button (button wasn't found)" in my Action 10. Are you able to provide a step by step screencapture of how you were able to get it to work?
Thanks a lot, work in Chrome too.
1. 'Launch new Edge' with the page you want
2. 'Display select folder dialog' - select folder to save. %SelectedFolder% as variable produced
3. 'Display input dialog' - define file name to save. Define %File% as variable produced
4. 'Set variable' %FileName% = %SelectedFolder%\%File%
5. 'Get window', foreground window
6. 'Focus window', by instance = %AutomationWindow%
7. 'Send keys' {LControlKey}({P})
From here, use Desktop Recorder to get UI elements:
8. Select Save as PDF and click button 'Save'
9. In the 'Save as' window, select 'Name' field and populate it with %FileName%
10. Click 'Save'
By the moment I use this option with Chrome "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --kiosk-printing for resolve the problem, the flow is working.
Switch to the Desktop recorder after you get to the print dialog.
The print dialog isn't a webpage so the Web recorder won't work on it
Hello everyone.
any help with this project would be much appreciated!
many thanks in advance
great1
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional