I've been working with node.js,the following function working fine in export to pdf.
but i want to this export file path sytem download folder path. i want to like this
for example: "c:/user/username/download"/filename.pdf";
Please help to how can i do it.
convertpdf : function(req,res){
var wkhtmltopdf = require('wkhtmltopdf')
var outputPDF = "c:/temp/"+uniqueIDs+".pdf";
_.map(exportDate, function(ep) {
html = html + "<tr><td>" + ep.orderno +"</td><td>" + ep.amount +"</td><td>" +ep.milestoneid +"</td><td>" + ep.storyid +"</td><td>" + ep.date +"</td><td>" + ep.status +"</td><td>" + ep.description +"</td></tr>";
});
html = html + "</table></body></html>";
wkhtmltopdf(html, {output: outputPDF}, function (err, result) {
if(!err) {
message = "successFully exported to" + outputPDF ;
return res.json({
message: message,
type: 'success'
});
}else {
message = "unsuccessFull exported to pdf";
return res.json({
message: message,
type: 'error'
});
}
}); // end of wkhtmltopdf
please any one help me how can i solve this issue.
Thanks.