title: How to get the rendered view as a string in express.js?
body: <p>I want to store the rendered view <code>res.render</code> as string to a variable and use <a href="https://github.com/marcbachmann/node-html-pdf" rel="nofollow noreferrer">node-html-pdf</a> package to print pdf:</p>
  <pre><code>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'));
  });
  </code></pre>