I want to store the rendered view res.render
as string to a variable and use node-html-pdf package to print pdf:
var pdf = require('html-pdf');
var html = res.render('my_view', res.view_data); // not work
pdf.create(html).toStream(function(err, stream){
stream.pipe(fs.createWriteStream('./foo.pdf'));
});
You'll need the app instance of express application.