Sorry it has been some time since you asked this question but, hopefully,
this reply will still be of some use.

I could be wrong but I believe that HWPF, unlike HSSF, does not yet expose
the colour table associated with the application, Word in this case. So, you
are able to get at the index of the colour but not to compare this to a
table of colours and to - possibly - convert it into an RGB value. The
option would be that indicated by the previous respondent; to map all of the
colours in Word, convert them into RGB values and then encode this data
within the application such that when HWPF returns an index number you are
able to map from that to the RGB.

Now, my next question may sound silly, but I do have a reason for asking it.
Are you aware that you can use Word itself to convert a .doc file into html?
Another question now, the application you are building with HWPF, is it to
run on a stand alone PC or will it be deployed across a network? If the
former, does that PC also run under Windows and does it have Word installed
on it? If you are running stand alone on a Windows PC with Word installed
then you could use the OLE/COM technique to grab a reference to an
'instance' of Word and use it to convert the files for you. There are
libraries such as SWT and JACOB that will allow you to write Java code that
will execute VBA commands and actually control Word itself. It really would
be as simple as opening a file and then saving it as a version of itself
converted into html.



Zsolt Koppany wrote:
> 
> Hi,
> 
> I would like display a word document in html. Actually the code works 
> more or less, I can even use font-names (using
> characterRun.getFontName()).
> 
> What does "characterRun.getColor()" return? How can I convert it to RGB?
> 
> Zsolt
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-convert-characterRun.getColor%28%29-to-RGB-tp22502565p22540061.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to