convert microsoft documents into pdf with nodejs [

2019-03-29 06:29发布

问题:

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

回答1:

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