title: Nodejs: Convert Doc to PDF
body: <p>I found some repos, which do not look as they are still maintained:</p>
  
  <ul>
  <li><a href="https://github.com/gfloyd/node-unoconv" rel="noreferrer">https://github.com/gfloyd/node-unoconv</a></li>
  <li><a href="https://github.com/skmp/node-msoffice-pdf" rel="noreferrer">https://github.com/skmp/node-msoffice-pdf</a>
  ...</li>
  </ul>
  
  <p>I tried the <a href="https://stackoverflow.com/questions/20959262/convert-microsoft-documents-into-pdf-with-nodejs">approach</a> with <code>libreoffice</code>, but the pdf output is so bad, that it is not useable (text on diff. pages etc.).</p>
  
  <p>If possible I would like to avoid starting any background processes and/or saving the file on the server. Best would be solution where I can use buffers. For privacy reasons, I cannot use any external service.</p>
  
  <p><code>doc buffer -&gt; pdf buffer</code></p>
  
  <h2>Question:</h2>
  
  <p>How to convert docs to pdf in nodejs?</p>