I'd like to open an HTML file as an OpenOffice.org Writer document using the Java API. I'm using the code from ConversionServlet example. If I open a Word file, I can save it as an OpenOffice.org Writer file without problems. However, it appears that an HTML file is opened as an OpenOffice.org Writer/Web document and OpenOffice.org Writer/Web does not support an sxw export filter.
We do the same job with this smale peice of dispacht code:
dim args6(1) as new com.sun.star.beans.PropertyValue args6(0).Name = "Name" args6(0).Value = "file:///g:/ENEWS/cf00Nart.HTM" args6(1).Name = "Filter" args6(1).Value = "HTML (StarWriter)"
dispatcher.executeDispatch(document, ".uno:InsertDoc", "", 0, args6()) dispatcher.executeDispatch(document, ".uno:Delete", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:SwBackspace", "", 0, Array())
We where leasy and uses the Dispacther but the filter name "HTML (StarWriter)" is the clue of the story.
Whe endup with a very good "copy" of the html file and the html styles (if present in the html document) are copyed as OOstyles into the new OOwriter document, a behaviour you not becomes with copy/pasting.
Hope it helps
Fernand
Is it possible to request that an HTML file be opened as an OpenOffice.org Writer document? How? I can achieve the effect I want from the user interface by opening the HTML file in OpenOffice.org Writer/Web, selecting all, copying and pasting into an empty OpenOffice.org Writer document. If an HTML document cannot be directly opened as an OpenOffice.org Writer document, how do I replicate the effect of copying and pasting via the Java API?
The the entire process I try to carry out is opening an HTML file as an OpenOffice.org Writer document, replacing the style definitions with the style definitions of another OpenOffice.org Writer document and then exporting the resulting document as .sxw and .doc (perhaps all so as .pdf and .rtf). Can I do the style definition replacement easily through the API or should I copy styles.xml on the file format level?
-- Henri Sivonen [EMAIL PROTECTED] http://hsivonen.iki.fi/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
