Save webpage to: PDF and/ or ePub
Save web pages either to PDF or ePub files; additionally, if possible, offer conversion of MHT files to either PDF or ePub files. Thanks for the opportunity of make these suggestions.
Pretty pointless writing any code to do this. Just select a PDF printer driver like Foxit Reader or CutePDF and print the page.
When opening the Print dialog, default setting in my Vivaldi is "Save to PDF".
A real benefit would be to create PDF with working links - doesn't work via print interface, though, that would need to be implemented in the browser itselt.
From what I see, there are extensions for open and save ePub.