Extract Embedded objects from ODT and other OO files

Creating a macro - Writing a Script - Using the API

Extract Embedded objects from ODT and other OO files

Postby billowgao » Fri Nov 24, 2017 9:44 pm

Hi there,

Is it possible to extract embedded objects from OpenOffice files?
If I check the zip file, I saw files like: Object 1, Object 2, Object 3, Object 4....
It seems that the original file was stored in the Object 1 with header.

Is there an API to read the header, then extract the embedded object from the Object # file?

Where I can find the header format?

Thanks,

Billow
OpenOffice 3.1 on Windows 2010
billowgao
 
Posts: 1
Joined: Fri Nov 24, 2017 9:40 pm

Re: Extract Embedded objects from ODT and other OO files

Postby Lupp » Sat Nov 25, 2017 1:58 am

At least if the embedded objects contain a OpenOffice / LibreOffice component it is possible.
How to do it is exempified for extraction from a AOO/LibO spreadsheet file (.ods) in an attachment to the recent thread https://forum.openoffice.org/en/forum/v ... ed#p431198 .
Doing it from a Writer file requires some changes due to the different document models. Text documents contain "textembeddedobject"s , and spreadsheet documents have a DrawPage per sheet while text documents only have one DrawPage for all of the document. In both cases any embedded object is represented by a shape containing it and being a member of a DrawPage in turn.
On Windows 10: LibreOffice 5.4.2 and older versions, PortableOpenOffice 4.1.3 and older, StarOffice 5.2
---
Maybe we might! (Create a powerful UFO: United Free Office)
Lupp from München
User avatar
Lupp
Volunteer
 
Posts: 1522
Joined: Sat May 31, 2014 7:05 pm


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 5 guests