List Info

Thread: Convert document to html




Convert document to html
user name
2006-11-22 15:06:31
Hi

I modified DocumentConverter.java example from OpenOffice
SDK to
create a document converter to html.

So if I want to convert a word.doc file containing text and
images in
word.html into a given folder, I type the following command
:
"java -jar DocumentConverter.jar word.doc
destination_dir"

it creates a new directory, and then it writes word.html and
images
into the directory destination_dir

Unfortunately, img html tags into word.html are not correct
as the
conversion writes
<IMG SRC="../word_html_m47c3a3cd.png">
instead of <IMG
SRC="word_html_m47c3a3cd.png">
(work.html and word_html_m47c3a3cd.png are actually in the
same directory)

Does anybody know how to correct this ? maybe add another
specific
propertyValues ?

I'm using
// Preparing properties for converting the document
           propertyValues = new
com.sun.star.beans.PropertyValue[3];
           // Setting the flag for overwriting
           propertyValues[0] = new
com.sun.star.beans.PropertyValue();
           propertyValues[0].Name = "Overwrite";
           propertyValues[0].Value = new Boolean(true);
           // Setting the filter name
           propertyValues[1] = new
com.sun.star.beans.PropertyValue();
           propertyValues[1].Name = "HTML
(StarWriter)";
           propertyValues[1].Value =
DocumentConverter.sConvertType;

thx


--
Sébastien Salou

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )