how to place HTML text into OpenOffice document using OpenOffice API
api, html, java, openoffice.org, uno
Solution
OK, this is what I've done to achieve this (using `OpenOffice UNO Api` with JAVA):
- Load `odt` document where we want to place `HTML` text.
- Goto place where you want to place `HTML` text.
- Save `HTML` text in temp file in the system (maybe it is possible without saving with http URL but I wasn't testing it).
- Insert `HTML` into odt following this instructions and passing URL to temp `HTML` file (remember about converting system path to `OO` path).
Problem
Lets see at this example: I've got `HTML` tagged text: ``` <font size="100">Example text</font> ``` I have `*.odt` (OpenDocument Text) document where I want to place this HTML text with formatting depends on HTML tags (in this example `font` tag should be ommited and text `Example text` should have 100point size font in result `*.odt` file). I prefer (but this is not strong requirement) to use OpenOffice UNO API for Java to achieve that. Is there any way to inject this `HTML` text into body of `*.odt` document with simple UNO API build-in HTML-odt converter or something like this (or I have to manually go through `HTML` tags in text and then use OO UNO API for placing text with specific formatting - e.g. font size)?