Hi there!

I'm trying to extract thumbnails from MS office documents and then
convert them to jpeg or gif. So far I've managed to extract an byte[]
array from a file, with the following lines:

try {
  SummaryInformation summaryInfo = new SummaryInformation(ps);
  Thumbnail thumbnail = new Thumbnail(summaryInfo.getThumbnail());
  byte [] thumbBytes = thumbnail.getThumbnail();
}
catch (UnexpectedPropertySetTypeException e)
{
  e.printStackTrace();
}
catch (HPSFException e)
{
  e.printStackTrace();
}

I've then tried writing the byte array to an FileOutPutStream and here I
am with a 21 KB file, that I'm not really sure what is and how to
display/read?

I've tried thumbnail.getThumbnailAsWMF but it's gives an exception
telling me that the format is not CFTAG_WINDOWS, wich probably is true ;-)

--
Espen �. Pedersen

Company: CORENA Norge AS
Address: Industritunet, Dyrmyrgt. 35, N-3611 Kongsberg
Phone:   +47 32 71 72 29
Skype:
E-mail:  [EMAIL PROTECTED]

http://www.corena.com




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to