Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

convert microsoft documents into pdf with nodejs [closed]

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

like image 327
lito Avatar asked Jan 06 '14 21:01

lito


People also ask

How do I use node JS Pdfkit?

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.


1 Answers

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

like image 109
Risto Novik Avatar answered Nov 15 '22 07:11

Risto Novik