DO you know any library to convert Microsoft Office documents like Word (.doc) or Excel (xlsx) into PDF using NodeJS? I have been looking around with no luck. Thanks
Creating a document Creating a PDFKit document is quite simple. Just require the pdfkit module in your JavaScript source file and create an instance of the PDFDocument class. const PDFDocument = require('pdfkit'); const doc = new PDFDocument; PDFDocument instances are readable Node streams.
Well, I think the best possible converting option would be using the LibreOffice headless command line option.
libreoffice --headless --convert-to pdf *.odt
So if you want to call from Node.js, you have to wrap the command line call into child process http://nodejs.org/api/child_process.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With