Hello,
I have a problem getting the text of a shape that has just one letter.When I tried to add more than one letter the text value of the shape is correct but when it is just one letter the text value is empty.
In the attached file you will find a visio file containing two elements in the group.one with the text value “A” and the other one is with text “C5”.
in the simple code below you will see in the console that only the text of the second element is correct. the first one is empty (just with tags but no text value).
License license = new License();
[//license.setLicense](https://license.setlicense/)(“C://Users//ark//Desktop//Visio Import//Aspose.Total.Java.lic.resj”);
license.setLicense(Licenses.class.getResourceAsStream("/Aspose.Total.Java.lic.resj"));
// The path to the documents directory.
String dataDir = “C://Users//ark//Desktop//Visio Import//Diagrams//”;
// Call the diagram constructor to load diagram
Diagram vdxDiagram = new Diagram(dataDir + “testLabelNotShowing.vsd”);
for (Shape shape : (Iterable) vdxDiagram.getPages().get(0).getShapes()) {
if ((shape.getType() == TypeValue.GROUP) && (shape.getShapes().getCount() > 0)) {
System.out.println(“ID group :” + shape.getID() + " " + shape.getText().getValue().getText());
for (Shape subShape : (Iterable) shape.getShapes()) {
System.out.println(“ID :” + subShape.getID() + " " + shape.getText().getValue().getText());
}
} else {
System.out.println(“ID :” + shape.getID() + " " + shape.getText().getValue().getText());
}
}
}