20-05-22 04:25 PM
When a virtual worker interacts with Print wizard on a webpage, the only viable option for interaction appears to be UI Automation mode.
However, since it takes 10-15 seconds for each interaction (i.e, read, select, and click), it amounts to be more than 1 minutes to print a webpage into a PDF file.
Is there any better way to do it in order to reduce the processing time?
Answered! Go to Answer.
20-05-22 08:08 PM
var Renderer = new IronPdf.ChromePdfRenderer();
using (var PDF = Renderer.RenderUrlAsPdf("https://en.wikipedia.org/wiki/Portable_Document_Format"))
PDF.SaveAs(@".\wikipedia.pdf");
Hope this helps you!
See you in the Community, bye 🙂
20-05-22 08:08 PM
var Renderer = new IronPdf.ChromePdfRenderer();
using (var PDF = Renderer.RenderUrlAsPdf("https://en.wikipedia.org/wiki/Portable_Document_Format"))
PDF.SaveAs(@".\wikipedia.pdf");
Hope this helps you!
See you in the Community, bye 🙂
23-05-22 01:33 PM
23-05-22 08:01 PM
Thanks for sharing your knowledge, Pablo. The approach 1 & 3 didn't work out for me, but approach 2 was able to successfully print a webpage to a pdf file!
This is the website that I referred to.
<https://superuser.com/questions/592974/how-to-print-to-save-as-pdf-from-a-command-line-with-chrome-or-chromium>
But, in my case, it was not possible to directly print from a webpage to a pdf. (Some special characters in the URL got in the way and the command prompt threw an error) So, I save a webpage as html file first, then turn it into a pdf file using approach 2.
Anyway, thank you for sharing your thoughts on this! Without it, I couldn't discover this solution.
23-05-22 08:07 PM
19-11-22 07:31 PM