This is my sample.js code wherein if i run this code the pdf will be generated. im trying to look in the internet where the pdf will be generated only if the button for generating pdf will be clicked. but i cannot find how to do it. this is the only code that i have please help me thank you. the button must be in html tho
var pdf = require('pdfkit');
var fs = require('fs');
var myDoc = new pdf;
myDoc.pipe(fs.createWriteStream('node.pdf'));
myDoc.font('Times-Roman')
.fontSize(48)
.text('Hello World', 100, 100);
myDoc.end();