I want to implement a button that will allow users to save a pdf copy of an html page. I know they can go through the 'print' interface, and select the 'save as pdf' option, but I'd rather have my button automatically select that option so that it automatically selects the option 'save as pdf' (or better yet, goes straight to the pdf download).
Is there a way to do this in javascript?
The "Save to PDF" button in the print dialog doesn't exist in Windows afaik. Anyway, there's no way you can do this with Javascript.
If you really want to give your visitors a PDF download of your page, you need to render that PDF on the server side and link the button to the PDF file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With