Save As PDF Chrome using selenium

Viewed 8478

I am looking to automate "Save as PDF" of Chrome using selenium. AFAIK it is not supported by the Selenium out of the box. Therefore, i am trying to write my own. I am having an issue. Actually clicking on the Print button in my webpage opens a new window with printable area. I am trying to switch to this window using SwitchTo. But it is timing out always.

2 Answers

You can add the options.AddArgument("--kiosk-printing"); to have it automatically click the print button.

That is working for me but I have a problem setting the printer to Save as PDF. It is printing to the printer instead.

Related