[Libreoffice] Does OO/LO have an API?

Kevin Hunter hunteke at earlham.edu
Sat Feb 5 23:42:24 PST 2011


Hullo List,

Is there an API for working with LO programmatically?  Rather than 
create an ODF with the myriad of tools available, I'm looking to 
directly invoke a LO object within a script.

I'm aware of the UNO bridge, but that requires a running instance of LO 
and connection to it as an external service.  What I'm looking for is a 
way to create and manipulate a document -- with LO routines -- without 
incurring unnecessary overhead.  Perhaps as a library.

For the sake of argument, here might be an example Python script:

-----
import libreoffice as LO

textdoc = LO.createTextDocument()
textdoc.properties.Title = "My API Created Document"
textdoc.cursor = 0   # move cursor to document head
textdoc.insertText( "A sample line." )
textdoc.saveAs( "/path/to/a/file.odt" )
-----

After about 20 minutes of Googling, and random grepping through the code 
base, I'm having no luck.  Does such a beast exist?

Thanks,

Kevin


More information about the LibreOffice mailing list