poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Toni Helenius <Toni.Helen...@syncrontech.com>
Subject RE: Extracting images from XSSF, no anchors
Date Thu, 19 Jul 2012 06:04:17 GMT
Hello,

Thanks for the quick reply. Here:
https://issues.apache.org/bugzilla/show_bug.cgi?id=53568

-----Original Message-----
From: Yegor Kozlov [mailto:yegor.kozlov@dinom.ru] 
Sent: 18. heinäkuuta 2012 18:53
To: POI Users List
Subject: Re: Extracting images from XSSF, no anchors

I confirmed the problem: shape.getAnchor() returns null when reading shapes from worksheet.

Can you create a new bug in Bugzilla and attach sample Java code that demonstrates the problem
and the .xlsx file you are reading.

Yegor

On Wed, Jul 18, 2012 at 5:02 PM, Toni Helenius <Toni.Helenius@syncrontech.com> wrote:
> Hello,
>
> I'm converting some HSSF specific code to use the generic SS one. I keep getting NPEs
from XSSFPicture functions (using the Interface, Picture) since they don't contain anchors.
Anchors are null. This generic code works just fine on HSSF.
>
> I also need the locations of the images, so the getAllImages() just doesn't cut it.
>
> XSSFDrawing drawing = ((XSSFSheet)sheet).createDrawingPatriarch();
>
> // Get the shapes
> for (XSSFShape shape : drawing.getShapes()) {
>         if (shape instanceof Picture) {
>                 ClientAnchor anchor = picture.getPreferredSize(); //Fails on XSSF
>                 }
>         }
>
> I found something here, possibly some coordinates that I need to convert but this seems
very ugly. If it even works...
> ((XSSFPicture)picture).getCTPicture().getSpPr().getXfrm().getOff();
>
> Can somebody help me please?
>
> --
> Toni Helenius
> Syncron Tech Oy
> FIN-53850 LAPPEENRANTA
> Street address: Laserkatu 6
> Mobile: +358 (0) 400 213 218
> Tel: +358 (0) 102176908
> Fax: +358 (0) 102176907
> www.syncrontech.com
> toni.helenius@syncrontech.com
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional 
> commands, e-mail: user-help@poi.apache.org
>

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


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


Mime
View raw message