samvera / hydra-derivatives

Derivative generation for Samvera repositories
Other
17 stars 25 forks source link

libreoffice silently fails #116

Open awead opened 7 years ago

awead commented 7 years ago

Libreoffice returns zero status when it errors:

awead@pooh T $ soffice --invisible --headless --convert-to doc --outdir /. non-existent-file.txt
Error: source file could not be loaded
awead@pooh T $ echo $?
0

Output is directed to STDERR, so maybe we should parse that and raise something?

rifuentesm commented 7 years ago

Hi, i have the same problem on Ubuntu Server 16.04 when trying to convert files, only the "file could not be loaded". I think its something that is not installed. The problem was solved installing the complete libreoffice suite (sudo apt-get install libreoffice) not only the "commons" package (sudo apt-get install libreoffice-common). Hope this helps.

AbhijitManepatil commented 2 years ago

A Python code to resolve issue : Error: source file could not be loaded following code worked

import subprocess
subprocess.call(['soffice',
                    '--headless',
                    '--convert-to',
                    'docx',                    
                    sourceFileLocation,
                    '--outdir',
                    destiFileLocation
                    ])