title: Best way to generate PDF from a template using nodejs
body: <p>Now, I'm looking for the solution to generate pdf (invoice with barcode, etc..) from template(html, css) in nodejs environment. I found there are several ways to do that such as <a href="https://www.npmjs.com/package/wkhtmltopdf" rel="nofollow noreferrer">wkhtmltopdf</a>, <a href="https://www.npmjs.com/package/phantom" rel="nofollow noreferrer">phantom.js</a> &amp; handlebars.js, <a href="https://www.npmjs.com/package/html-pdf" rel="nofollow noreferrer">html-pdf</a>. What I'm concern is which is the best way to solve this problem.</p>
  
  <p>Also, I have look at <a href="https://www.npmjs.com/package/jspdf" rel="nofollow noreferrer">jsPDF</a>, an client side generation, but it seem not suitable for production right now.</p>
  
  <p>So, Anyone have used one of these library in production, please give me an advised.</p>
  
  <p>Many thanks !</p>
  
  <p><strong>UPDATED:</strong></p>
  
  <p>Headless chromium is now ready for use.</p>
  
  <p>Have some limitation (e.g: custom header, footer), but work great in almost cases.
  <a href="https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md" rel="nofollow noreferrer">https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md</a></p>
  
  <p><strong>UPDATED: 4/2019</strong></p>
  
  <p>Now, Puppeteer is a major library for generating pdfs</p>
  
  <p><a href="https://github.com/GoogleChrome/puppeteer" rel="nofollow noreferrer">https://github.com/GoogleChrome/puppeteer</a></p>