I've been googling about this and found this should work
soffice --convert-to html:HTML:EmbedImages file_to_convert
To convert the file I'm using this:
Code: Select all
outProps = (
PropertyValue( "FilterName" , 0, 'HTML' , 0 ),
PropertyValue( "EmbedImages" , 0, True , 0 ),
PropertyValue( "Overwrite" , 0, True , 0 ),
PropertyValue( "OutputStream", 0, OutputStream(), 0)
)
try:
filename="/home/informemedico/rtftoimpacs/salida.html"
# document.storeToURL("file://" + filename, outProps)
document.storeToURL("private:stream", outProps)
document.dispose();
except IOException as e:
sys.stderr.write(filename)
sys.stderr.write("Error: " + e.Message)