Below is the code; nothing fancy, it just gets all the shapes on the page (including shapes in groups) and prints their names. I get the same result with Aspose 22.4 (no exception, output:
Page Blatt-1, ID:5
shape: id:1451, name:Sheet.1451, nameu:
shape: id:63, name:Sheet.63, nameu:
).
import java.util.;
import java.io.;
import com.aspose.diagram.*;
public class Bug {
public static void addShapes(ArrayList res, Shape shape) {
res.add(shape);
ShapeCollection shapes= shape.getShapes();
for (Object s0 : shapes) {
addShapes(res, (Shape)s0);
}
}
public static ArrayList<Shape> getShapes(Page page) {
ArrayList<Shape> res= new ArrayList<Shape>();
ShapeCollection shapes= page.getShapes();
for (Object s0 : shapes) {
addShapes(res, (Shape)s0);
}
return res;
}
public static void debugShapes(Diagram diagram) throws Exception {
PageCollection pages= diagram.getPages();
for (Object p0 : pages) {
Page page= (Page)p0;
System.out.println("Page "+page.getName()+", ID:"+page.getID());
for (Object s0 : getShapes(page)) {
Shape shape= (Shape)s0;
System.out.println("shape: id:"+shape.getID()+", name:"+shape.getName()+", nameu:"+shape.getNameU());
}
}
}
public static void main(String[] args) throws Exception {
String filename= args[0];
FileInputStream fin= new FileInputStream(filename);
LoadOptions loadOptions = new LoadOptions();
Diagram diagram = new Diagram(fin, loadOptions);
debugShapes(diagram);
}
}