I am using node, express and ejs to build a web app and I would like to convert a page to a pdf
on button click.
The route definition for the request created for the button is as follows:
const gp = require('./generatePDF');
app.get('/pdf', gp.generatePDF)
The function is handled like so:
const generatePDF = (request, response) => {
/* do some stuff to generate content on the ejs page */
response.render('pages/pagetoconverttoPDF');
}
module.exports = {
generatePDF,
}
What would be the best way to download / view this page as a pdf
?