Call librefoffice in nodejs

asked 2016-03-01 04:38:18 +0100

hguser gravatar image

I tried to conver the office to pdf by librefoffice,

const exec = require('child_process').exec;
const child = exec('soffice --headless --convert-to pdf x.docx',
  (error, stdout, stderr) => {
    // now the file x.pdf may not be generated yet.
});

However it seems that the soffice --convert-to will not block the process, then I wonder if it is possible to wait until the job complete?

edit retag flag offensive close merge delete