Using --convert-to output to stdout?

Currently I have a script like so:

#!/bin/bash
#usage "script.sh file.xlsx"
libreoffice --headless --convert-to html $1 2>/dev/null >/dev/null
html=$(cat ${1%.xlsx}.html)
rm ${1%.xlsx}.html
#... work with ${html}

I was just wondering if I could do this without writing the file?
I didn’t see an option to select an output name either that is why I use ${1%.xlsx}.html as the filename

I have people send me xlsx files that have selected background colors and I wanted to write scripts to move things around as I needed. I found libreoffice’s html output to be easy to work with in my scripts and was just wondering if I could drop a couple step and save disk writes (I could always define a ramdisk and use the --outdir to point to ramdisk to stop it from writing to a real disk.)

LibreOffice doesn’t output documents to stdout, except for --cat option, which uses plain text filter (not HTML; not configurable).

Even though it is a 7 years old thread, I searched the internet and got this thread as a result. But it was not working for me. Therefore, I do find it relevant, and hope other users will see it this way too. Turns out it was not working for me because of the warning at Be aware that LibreOffice Writer must be closed, which is only 2.5 years old.
libreoffice --cat your_file.odt

Ask/Guide - How to use the Ask site - The Document Foundation Wiki #More_details


129713 – soffice --cat option doesn't output document text contents when there is another instance running
works fine on linux.