Jiangpeng Shi <Jiangpeng.Shi <at> UTSouthwestern.edu> writes:

> 
> Hey Mark, 
> 
> Thank you very much for the help. I learned a lot about POI from you in this 
couple of days. Thank you, David,
> too. I checked the source code about ExcherContainerRecord, but I think I am 
not that smart to make any
> change in that class to make things work.  
> I also checked the source code of HSSFWorkbook, and trace the method 
getAllPictures() and
> searchForPictures(List escherRecords, List<HSSFPictureData> pictures). I can 
see that all the
> pictures data are retrieved by this two methods. And it looks like image 
record is saved in
> EscherBlipRecord, as a child of EscherBSERecord. Unfortunately I couldn't get 
any position
> information from this two class. 
> 
> I will keep working on this issue, and for sure I will post here if I get any 
progress. Thanks a lot for all your
> help. I really appreciate it. 
> 
> --Jerry
> 
> >>> MSB <markbrdsly <at> tiscali.co.uk> 6/10/2010 10:28 AM >>>
> 
> Hello Jerry,
> 
> David is quite correct to point us in the direction of the fillFields()
> method and I have managed to replicate the problem myself by creating a
> worksheet with around fifty images to confirm this; processing that workbook
> produced the same error message - well similar as the number of bytes
> remaining was different.
> 
> The check is really a sensible one to make as it prevents the code from
> throwing an IndexOutOfBoundsException or something similar. Whilst the
> solution is fairly obvious - we need to get that remaining data - the bad
> news is that I will not be able to devote much time to the problem over the
> next few days and do not have any confidence in my ability to work through
> the API's code to identify a solution in any case. So, you may want to raise
> this as a bug so that it comes to the attention of more capable members
> people. Having said that, I will continue to trace through the sequence of
> method calls to see if anything obvious presents itself.
> 
> Yours
> 
> Mark B
> 
> > jerry-112 wrote:
> >> 
> >> 
> >> Mark, thank you very much for the help. I tried this code and it works
> >> pretty good. I can get a list of column and row number. But then I
> >> noticed
> >> it couldn't retrieve all the images:
> >> 
> >> I tried to get all images from a single sheet xls file by flowing code: 
> >> 
> >>                                InputStream myxls = new
> >> FileInputStream(filename);
> >>            HSSFWorkbook wb     = new HSSFWorkbook(myxls);
> >>            List list = wb.getAllPictures();
> >> 
> >> I can get a list of Pictures as total as 65 element; but when I tried to
> >> get their position data by the code you provided, it only return 55
> >> positions. I double checked spreadsheet and confirm there are 65 Pictures
> >> in that sheet. I guess something missed over there. I might be confused
> >> by
> >> those Children, etc....Any suggestion is appreciated. Thanks again for
> >> the
> >> help. 
> >> 
> >> --Jerry 
> >> 
> >> 

Hi Guys,

Thanks for this work I realy appreciate your knowledge sharing!
One more question: if we can get a list of all pictures through sheet object 
like this:

List<HSSFPictureData> lst = sheet.getWorkbook().getAllPictures();

and on the other part if we are able to fetch all anchors detail, then how to 
map HSSFClientAnchor objects to HSSFPictureData objects or the opposite?

My need is to get a picture data as bytes, then it's anchor details and finaly 
display the result on screen at target position and size for my users...

Thanks a lot for your support

André



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

Reply via email to