Search code examples
node.jspdfdoc

Convert any document, image, text file into PDF


I want to convert any documents or image or text file into PDF for all the OS.

I tried the approach with node-msoffice-pdf, and its working fine for Windows OS but not working in other OS.

Question:

How to convert docs, images, textfile to pdf in nodejs?


Solution

  • I used wkhtmltopdf from years to manage pdf conversion.

    https://github.com/devongovett/node-wkhtmltopdf

    You can either render an html file and pass it to the module, or render a pdf directly from an url.