You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Zachary Mitchell <za...@internode.on.net> on 2010/05/03 06:32:15 UTC

POI use questions.


 -I can set a write password on an HSSFWorkBook.
 How may I set a read password on an HSSFWorkBook?

 -How do I add a newly created Picture object top an HWPFDocument object, representing
  a word file under constructions?

-How do I specify a Picture Object's Dimensions and position in the overall Word
document object?

 -How do I add an HSSFPictureData object to a particular
 cell in an HSSFWorkSheet object?

-Using Picture, or the similar List<HSSFPictureData>  or List<HSSFObjectData>,
  do the simlar things for an Excel  HSSFSheet, not in the HSSFWorkBook ?

Re: POI use questions.

Posted by David Fisher <df...@jmlafferty.com>.
Hi Zachary,

I am forwarding to you an answer to a similar question about  HSSF Password support.

> -I can set a write password on an HSSFWorkBook.
> How may I set a read password on an HSSFWorkBook?

The answer to the first is likely no and the second question is probably yes. You'll need to give it a try.

Regards,
Dave

Begin forwarded message:

> From: Josh Micich <jo...@gmail.com>
> Date: May 3, 2010 4:30:59 PM PDT
> To: David Fisher <df...@jmlafferty.com>
> Cc: Jacob Feldman <ja...@openrules.com>, wave@apache.org
> Subject: Re: how POI reads encrypted workbooks
> 
> Hello Jacob,
> 
> I remember working on 47652 and I'm pretty sure HSSFWorkbook also
> utilises the new functionality (not just ExcelExtractor).  It might
> have been better to include a test case using HSSFWorkbook to make
> this clearer.
> 
> Biff8EncryptionKey.setCurrentUserPassword("password");
> InputStream is = HSSFTestDataSamples.openSampleFileStream("password.xls");
> HSSFWorkbook wb = new HSSFWorkbook(is);
> 
> I haven't tried this code, but I believe it should work.
> 
> Functionality is not yet complete but as far as I understand POI
> supports reading, modifying and writing back of encrypted workbooks.
> Biff8EncryptionKey uses a ThreadLocal, so it *is* threadsafe.
> 
> Some notable things not yet implemented:
>  - Creating encrypted workbooks
>  - Removing encryption from an existing workbook
>  - Adding encryption to an existing workbook
>  - Changing the encryption password
> 
> It shouldn't be too difficult to add these in though.  Most of the
> leg-work was in getting the BIFF record encoding right.
> 
> Note - this functionality is all BIFF8 (Excel 95-2003) specific.
> Encryption is handled very differently in the OOXML version of the
> file spec.  I'm not sure if POI has any encryption support on the
> OOXML side yet.
> 
> regards,
> Josh


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org