You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2011/03/28 09:51:19 UTC

DO NOT REPLY [Bug 49423] Data got lost when trying to get EscherContainerRecord

https://issues.apache.org/bugzilla/show_bug.cgi?id=49423

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID
           Severity|blocker                     |normal

--- Comment #6 from Yegor Kozlov <ye...@dinom.ru> 2011-03-28 03:51:16 EDT ---
HSSF provides a way to iterate over shapes and read their positions. The
following code works fine to me:

        HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(file));
        int numSheets = workbook.getNumberOfSheets();
        for (int i = 0; i < numSheets; i++) {
            HSSFSheet sheet = workbook.getSheetAt(i);
            List<HSSFShape> shapes = sheet.getDrawingPatriarch().getChildren();
            for(HSSFShape shape : shapes){
                HSSFAnchor anchor = shape.getAnchor();

                if(anchor instanceof HSSFClientAnchor){
                    // absolute coordinates
                    HSSFClientAnchor clientAnchor = (HSSFClientAnchor)anchor;
                    System.out.println(clientAnchor.getRow1() + "," +
clientAnchor.getRow2());
                } else if (anchor instanceof HSSFChildAnchor){
                    // shape is grouped and the anchor is expressed in the
coordinate system of the group 
                    HSSFChildAnchor childAnchor = (HSSFChildAnchor)anchor;
                    System.out.println(childAnchor.getDy1() + "," +
childAnchor.getDy2());
                }
            }
        }

If this code misses some images then please attach the problem file and a junit
demonstrating what particular is missing. 

Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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