[Libreoffice] SDK LibreOffice How to get document as object?

Michael Stahl mstahl at redhat.com
Tue Nov 8 09:43:47 PST 2011


On 08/11/11 15:55, webmaster at csz-online.de wrote:
> Hi,
>
> I'm currently working on some data format exportation tests with the
> LibreOffice SDK and Java. I want to develop an addon, which can export
> the current opened file in another dataformat. I already have some
> converter-methods, which can be used. The only thing I need is to get
> access to the opened document in some Java object(s).

i'm not sure i understand: do you want to create a new export filter, or 
use the existing filters via UNO?

> I already tried to search in the development manuals of LibreOffice and
> OpenOffice but there was no result. Perhaps anyone of you guys could help?

for storing a loaded document with a certain export filter, see:

http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Storing_Documents

for creating a new export filter, you need to implement an 
css.document.ExportFilter service; start here:

http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Filter

here the document css.frame.XModel is given as parameter to 
setSourceDocument, and you can use UNO API to pull out the content.

except if you can implement the filter in XSLT with ODF as the source, 
then it is much easier and you don't need to write any UNO stuff.

> Best regards,
> Clemens Schulz

regards,
  michael



More information about the LibreOffice mailing list