We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Cp tag issue


Please check the console output below. As you can see there are two lines of empty text being printed between and which indicates that this cp tag belongs to those two lines of text and not “PP14 -”. Is this normal behavior, that there is an empty text between these two tags? Is it possible for some text not to have it’s own cp tag?


public void asposeTest() throws Exception {
Diagram diagram = new Diagram(“Test.vsd”);
ShapeCollection shapes = diagram.getPages().get(0).getShapes();
Shape shape = shapes.get(0);
for (FormatTxt txt : (Iterable) shape.getText().getValue()) {

Console output:
Vendor Scheduling

PP14 -
Vendor Material Planning

Hi Zeljko,

Thank you for contacting support. Please note, the Text element of a shape has multiple character rows (a.k.a Char) and each cp tag represents the properties of a character row. In your source Visio diagram, there are 4 character rows and 4 cp tags. The two empty lines don’t mean the lines of text. It is a line break element. The complete string is as follows: “Vendor Scheduling\nPP14 - Vendor Material Planning\n”

I’m not certain about the possibility of some text without the cp tag. However, Aspose.Diagram API mimics the behavior Microsoft Office Visio. So, please refer to the following Microsoft help topics: [Working with a Shape’s Text in DatadiagramML] and [Manipulate the Visio file format programmatically].

Please let us know in case any further assistance or questions.