https://issues.apache.org/bugzilla/show_bug.cgi?id=53568
Priority: P2
Bug ID: 53568
Assignee: [email protected]
Summary: Pictures in XSSF have NULL anchors
Severity: normal
Classification: Unclassified
Reporter: [email protected]
Hardware: PC
Status: NEW
Version: 3.8
Component: XSSF
Product: POI
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.
FileInputStream file = new FileInputStream(new File("c:\\temp\\test.xlsx"));
Workbook wb = WorkbookFactory.create(file);
Sheet sheet = wb.getSheetAt(0);
XSSFDrawing drawing = ((XSSFSheet)sheet).createDrawingPatriarch();
// Get the shapes
for (XSSFShape shape : drawing.getShapes()) {
if (shape instanceof Picture) {
ClientAnchor anchor = picture.getPreferredSize(); //Fails on XSSF, NPE
}
}
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]