Calling LibreOffice to convert a document to text...
This works fine from the linux command line:
soffice --headless --convert-to txt:\"Text\" docume
This is the code you should use:
subprocess.call(['soffice', '--headless', '--convert-to', 'txt:Text', 'document_to_convert.doc'])
This is the same line you posted, without the quotes around txt:Text
.
Why are you seeing the error? Simply put: because soffice does not accept txt:"Text"
. It only accepts txt:Text
.
Why is it working on the shell? Your shell implicitly removes quotes around arguments, so that the command that gets executed is actually:
soffice --headless --convert-to txt:Text document_to_convert.doc
Try running this command:
soffice --headless --convert-to txt:\"Text\" document_to_convert.doc
Quotes won't be removed and you'll see the Please verify input parameters message you are getting with Python.