In order to load a document by a script into an office instance, I currently use the loadComponentFromURL() from the XComponentLoader interface. However, this accepts only a URL as parameter.
Is there a way to read a document directly from stdin? Or: can I pipe data into office?
Load document from stdin instead of an URL
Load document from stdin instead of an URL
Mac 10.14 using LO 7.2.0.2, Gentoo Linux using LO 7.2.3.2 headless.
Re: Load document from stdin instead of an URL
There is discussion on this at
http://unix.stackexchange.com/questions ... -via-stdin
Other searches suggest the best way (=simplest) may be to make a file of the data and then to open that automatically in OpenOffice.
http://unix.stackexchange.com/questions ... -via-stdin
Other searches suggest the best way (=simplest) may be to make a file of the data and then to open that automatically in OpenOffice.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: Load document from stdin instead of an URL
Hmpf. Looks like files only...
I wonder if I could pass a local /dev/stdin as a URL. No, can't:
I wonder if I could pass a local /dev/stdin as a URL. No, can't:
Code: Select all
Unsupported URL <file:///dev/stdin>: "type detection failed"
Mac 10.14 using LO 7.2.0.2, Gentoo Linux using LO 7.2.3.2 headless.
Re: Load document from stdin instead of an URL
I came across this thread today which uses a byte array of the file and converts it to an input stream that's then loaded. Looks to me like an appropriate solution? Only problem is that I can't quite figure out how the ByteArrayXInputStreamAdapter is accessible with Python UNO, or if this is something I'd have to implement and provide myself.
Mac 10.14 using LO 7.2.0.2, Gentoo Linux using LO 7.2.3.2 headless.