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.

#More_details

I will give it if you insist but at this point I find it less important.

works fine on linux.

It depends. In my case, it probably depends on the way the graphical environment is constructed. My graphical environment is an old style window manager only, not a modern desktop environment. Here, when the window manager is fired, it executes a file with something like

xterm1 &
libreoffice &
xterm2

Now if I issue a libreoffice --cat doc in xterm1 I get no output. But if I quit the libreoffice instance that the window manager has created, and starts a new libreoffice instance from xterm1 and issue a --cat command on xterm2, I get the expected output on xterm1.

Can it be that libreoffice is searching for some sort of a controlling terminal?
Is it worth recording a link to this thread at 129713 – soffice --cat option doesn't output document text contents when there is another instance running?