mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-05-09 22:26:18 +02:00
LibreOffice: rephrase comments (conversion is generic and not PDF-specific)
This commit is contained in:
parent
df5618b274
commit
73d09f1c6c
@ -56,7 +56,10 @@ function doConvertTask(task, callback) {
|
||||
var tmpDir = os.tmpdir();
|
||||
|
||||
async.series([
|
||||
// Generate a PDF file with LibreOffice
|
||||
/*
|
||||
* use LibreOffice to convert task.srcFile to another format, given in
|
||||
* task.type
|
||||
*/
|
||||
function(callback) {
|
||||
var soffice = spawn(settings.soffice, [
|
||||
'--headless',
|
||||
@ -81,17 +84,18 @@ function doConvertTask(task, callback) {
|
||||
stdoutBuffer += data.toString();
|
||||
});
|
||||
|
||||
// Throw an exception if libreoffice failed
|
||||
soffice.on('exit', function(code) {
|
||||
if (code != 0) {
|
||||
// Throw an exception if libreoffice failed
|
||||
return callback(`LibreOffice died with exit code ${code} and message: ${stdoutBuffer}`);
|
||||
}
|
||||
|
||||
// if LibreOffice exited succesfully, go on with processing
|
||||
callback();
|
||||
})
|
||||
},
|
||||
|
||||
// Move the PDF file to the correct place
|
||||
// Move the converted file to the correct place
|
||||
function(callback) {
|
||||
var filename = path.basename(task.srcFile);
|
||||
var pdfFilename = filename.substr(0, filename.lastIndexOf('.')) + '.' + task.type;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user