poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashit Gandhi <ashit.gandh...@gmail.com>
Subject Extracting Shape Information using XSSF
Date Thu, 26 Sep 2013 12:59:46 GMT
I am new to Apache POI and have recently stated coding.
My goal is to provide tools to quality check org charts being created by
some technicians.
In other words, I need to be able to extract and analyze SHAPE information,
including simpel shapes and connectors.

I cant find the appropriate methods to extract the fill color, its
linestyle, etc.

Can anyone suggest a way to do this? My code (snippet) is as below:


   XSSFWorkbook wb = new XSSFWorkbook(file);

   XSSFSheet s = wb.getSheetAt(0);
   XSSFDrawing drpt = null;
   for(POIXMLDocumentPart dr : s.getRelations()){
    if(dr instanceof XSSFDrawing){
     drpt = (XSSFDrawing) dr;

   if (drpt != null)
    System.out.println("Found drawings");

    int i = 0;
    for (XSSFShape shp :drpt.getShapes())
     if (shp instanceof XSSFConnector)
      XSSFConnector xsc = (XSSFConnector) shp;
      System.out.println("Connector XML " + xsc);
     if (shp instanceof XSSFSimpleShape)
      XSSFSimpleShape xss = (XSSFSimpleShape) shp;
      System.out.println("Simple Shape XML " + xss);




Currently, my code prints the XML bean object data, but I am interested in
getting the RGB color, line thickness, etc....



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message