I have a csv file that contains lists of URLs.
I’m able to open this csv and step into each row and navigate to the lists URLs and open within a browser.
I need a mechanism by which I can save or print that Web Page into a PDF document.
I need to help with this save or print as PDF part. Please let me know how I can achieve this. Thanks a a lot in advance.
Once you open the pdf kindly do the following to save your pdf and to the folder you need to save with
Once pdf is opened use a send hotkey activity lie ctrl+p, while doing that itself before getting printed it will get saved first and again with keys “enter” to print it or if not we can pass a send hotkey activity again with keys ctrl+s
Fine while saving the file if it asks for the folder to be saved, you can mention like “Folderpath” + ""+“Filename” + “.pdf” by using click and type into activity and pass that as input to the save field buddy
Thats all buddy you are done
Kindly try this and let know buddy whether this works or not
When I try to send enter key to the window I’m getting an error message “Value does not fall within the expected range”. In the Selector Editor I’m see app as “acrord32.exe” which is for Acrobat Reader I believe. Here is the full string
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.AggregateException: One or more errors occurred. ----> System.ArgumentException: Value does not fall within the expected range.
at UiPath.UiBrowserClass.get_node()
at UiPath.Core.Browser.get_Element()
at UiPath.Core.Activities.Target.<>c__DisplayClass35_0.b__0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
— End of inner ExceptionDetail stack trace —
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at UiPath.Core.Activities.Target.GetBaseElement(ActivityContext context, CancellationToken token)
at UiPath.Core.Activities.Target.GetFindMethod(TargetFindCriteria criteria, CancellationToken ct, Int32 defaultTimeout)
at UiPath.Core.Activities.Target.GetElementAsync(TargetFindCriteria criteria, CancellationToken ct, Nullable1 delayBefore) at UiPath.Core.Activities.TargetAsyncActivity.GetElementAsync(AsyncCodeActivityContext context, CancellationToken ct, Nullable1 delayBefore)
at UiPath.Core.Activities.Click.ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken)
at UiPath.Core.Activities.TaskAsyncCodeActivity.ExecuteAsyncWithResult(AsyncCodeActivityContext context, CancellationToken cancellationToken)
at UiPath.Core.Activities.TaskAsyncCodeActivity`1.BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, Object state)
at System.Activities.AsyncCodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
I can understand your problem. I hope you’re getting an error while sending hotkeys (ctrl+p) on the Acrord32.exe. Can you please check you’re a selector of SendHotkeys please use * for unique reference for a selector.
The error is not happening when sending the ctrl+p and it opens the print dialog as expected, the exception occurs when I send the ‘enter’ key to accept and close the print dialog. I also tried Click Button activity to press the OK button instead of sending Hotkey ‘enter’ and I get same error there as well.
Buddy great,
Buddy you were actually going good with enter key, the thing is it didn’t get to the right field that would get triggered when we press enter, so use a tab until it reaches the enter field and then use again send hotkey with enter key
That was the reason for error value doesn’t fall within the range, try buddy that would work and kindly let know whether this works or not
I’ve tried that and that didn’t work either. Besides since OK is the default button it is able to trigger it no matter where my cursor is when I tried it manually. I’ve also tried giving some delay time to make sure it waits few seconds in the print dialog window before sending enter key
Send Ctrl + P Hotkey over Browser window, Change option to Save as PDF in Print Dialog (Attach it or Interact with Keyboard inside) and other settings if needed.
Attach Save as Window, Type PDF Path and (Send Enter, Click Save, Send Alt+S, etc.)
@asesor-rpa I opened Chrome and navigated to the url I want to print to pdf. For this I did exactly what you said, viz, send hotkey CTRL+P. But strange that system opened this
When I manually hit CTRL+P on Chrome, I see what is displayed by other users in this post(sorry, I can’t post two images in one post because I am a new user on UiPath community :D)
What is the difference in UiPath sending CTRL+P and I do it manually on the exact same page and same browser
In my current Chrome window when I hit Ctrl + P appears the Chrome Print Dialog in a separate window. When I hit Ctrl + Shift + P appears classic window print dialog window. I’m not sure about situation where same hotkey shows different UI. Try updating Chrome or Use Firefox to see if there’s a bug with Chrome