I am working on mean stack project. In this i have a requirement to generate pdf dynamically and send it on the user email id. But pdf should be password protected when user enter the password he can see the content of pdf. I am using html-pdf node module for generating pdf but i don't have any idea how can i make it password protected. Please help me anyone.
Below is my code for generating pdf :
// This Is Use To Genrate Pdf.
app.post("/upload", function(req, res) {
var html = req.body.html;
var loanId = req.body.loanid;
var options = { format: 'Letter'};
var pdfname = 'loan_'+loanId+'.pdf';
pdf.create(html, options).toFile('../client/app/loanpdf/'+pdfname, function(err, res) {
if (err) return console.log(err);
});
res.status(200).send({'pdfname':pdfname});
});
Thanks in advance :)