3 Answers
New AnswerI don't know much about web, but I do know that you can upload a PDF version of your page to a source, and then link the source to your button so it downloads from the source. Not sure if JS has a built-in function to directly convert whatever you have to pdf and just place it right in front of you.
Easiest way without doing anything -> open browser -> open your webpage -> goto options (3 dot icon in your browser) ->(If on PC) Print (else If on android phone using chrome) share -> print / save as PDF
But if you want add a button check this link -> https://stackoverflow.com/questions/6896592/is-it-possible-to-save-html-page-as-pdf-using-javascript-or-jquery