title: How to convert html to pdf in node.js using `html-pdf`module
body: <p><br/>
  <br/>
  I am generating invoice using <code>html-pdf</code> module.<br/>
  I am able to generate pdf when I am passing web page local address, i.e stored in folder.<br/>
  But my requirement is to hit API, and then generate pdf file.<br>
  <br/>
  <em>Can I do that using <code>html-pdf</code> module, or there is some other module that can do that?</em></p>
  
  <p><br/>
  <br/>
  <strong>Code</strong><br/></p>
  
  <pre><code>var fs = require('fs');
  var pdf = require('html-pdf');
  var html = fs.readFileSync('./test/businesscard.html', 'utf8');
  var options = { format: 'Letter' };
  
  pdf.create(html, options).toFile('./businesscard.pdf', function(err, res) {
    if (err) return console.log(err);
    console.log(res); // { filename: '/app/businesscard.pdf' }
  });
  </code></pre>
  
  <p><br/>
  Please help.</p>