While using browsers like Chrome and Firefox, there is an option to print the page to PDF (that is saving the webpage as a PDF file).
<a href="JavaScript:window.print();">Print this page</a>
This code opens up the print page from where the user should manually choose print to PDF. Can this be done automatically? If so please help.