Working with comments

HI,
there seems to be problem if you have file with multiple pages and you try to add comments on them. If both pages already have comments, you can get to situation where adding new comment is not possible anymore. Same applies to updating comments - as soon as you have multiple pages and comments on them an error is thrown.

Adding new comments to file with multiple pages and comments:

        dataDir = "C:\\Users\\......";

        // Load diagram
        Diagram diagram = new Diagram(dataDir + "Comments.vsdx");

        // Add comment
        diagram.Pages[1].AddComment(7.205905511811023, 3.880708661417323, "test@");

        // Save diagram
        diagram.Save(dataDir + "AddComment_out.vsdx", SaveFileFormat.VSDX);

and same file when comments are updated:

        foreach (Annotation annotation in annotationCollection)

        {
            if (annotation.MarkerIndex.Value == "1")
            {
                annotation.Comment.Value = targetText;
            }
        }

Comments.zip (17.8 KB)

@rlaskowski.sdl,
We managed to replicate the said issues in our environment and have logged tickets as below:

DIAGRAMNET-51354: Cannot edit comments on the Visio page
DIAGRAMNET-51353: Cannot add another comment in the Visio page

We have linked your post to these tickets and will keep you informed regarding any available updates. We are sorry for the inconvenience caused.

In reference to your second scenario, the marker index value does not match with any comment marker index value. However, we are not able to edit comment string which is logged under the ticket ID DIAGRAMNET-51354.

@imran.rafique
We actually found that if the file contains any comments we will get errors when saving any changes.
Can that be escalated as it makes the Visio library unusable for us?
We are paying customer, is there any other way of reporting bugs?

Regards
Patrik

@rlaskowski.sdl,
Both the linked ticket IDs DIAGRAMNET-51353 and DIAGRAMNET-51354 have been resolved. Please download and try the latest version 17.9 of Aspose.Diagram for .NET API and let us know how that goes into your environment.

Hi,
no errors are thrown anymore, but we found that some of the comment attributes are removed:
// Load diagram
Diagram diagram = new Diagram(dataDir + “Comments.vsdx”);

        var firstPageAnnotations = diagram.Pages[0].PageSheet.Annotations;

        foreach (Annotation annotation in firstPageAnnotations)
        {
            var date = annotation.Date.Value;
        }

        // Save diagram
        diagram.Save(dataDir + "Comments_Target.vsdx", SaveFileFormat.VSDX);

        // Load diagram
        Diagram targetDiagram = new Diagram(dataDir + "Comments_Target.vsdx");

        var targetFirstPageAnnotations = targetDiagram.Pages[0].PageSheet.Annotations;

        foreach (Annotation annotation in targetFirstPageAnnotations)
        {
            // date will be default one: {1/1/0001 12:00:00 AM} 
            // because of EditDate attribute missing
            var date = annotation.Date.Value;
        }

Visio comments have Date and EditDate attributes. Using latest version of Aspose - 17.9, after the diagram is saved, the EditDate attribute is missing in target file. Next time we would process such file, the date of comments will be set to default one: 1/1/0001 12:00:00 AM
And if we process the file once more, then also Date attribute will be gone.
Comments.zip (17.5 KB)

@rlaskowski.sdl,
We managed to replicate the said problem in our environment. It has been logged under the ticket ID DIAGRAMNET-51357 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.

@rlaskowski.sdl,
The linked ticket ID DIAGRAMNET-51357 has been resolved. If there is no issue in the quality assurance phase, then this fix will be included in the next version 17.10 of Aspose.Diagram for .NET API. We will notify you once the next version is published.

Hi,
we found another issue loading a Visio file that has 2 shapes grouped together and one of them has a comment. Due to the fact of grouping, an error is thrown with next message: " Error in element AuthorList in \VisioDocument.LoadAuthor ".

Code used:

        // Load diagram
        Diagram diagram = new Diagram(dataDir + "Comment_in_Group.vsdx");

Can you please validate it with your 17.10 release?

Comment_in_Group.zip (16.1 KB)

In addition, we found that none of the comments attributes (author, date, etc.) cannot be changed - is that something you can consider for future?

Regards

@rlaskowski.sdl,
We managed to replicate this error in our environment. It has been logged under the ticket ID DIAGRAMNET-51359 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.

Microsoft Visio application adds Operating System user as an author and the recent system date. It does not allow to edit the author and comment date. Aspose.Diagram for .NET API mimics the behavior of the Microsoft Visio application.

@rlaskowski.sdl,
In reference to the ticket ID DIAGRAMNET-51357, please download and try the latest Hotfix version: Aspose.Diagram for .NET 17.9.1 and let us know how that goes into your environment.

Hi,
yes, it seems to work as expected.
Regards

@rlaskowski.sdl,
Thank you for the confirmation. The linked ticket ID DIAGRAMNET-51357 will be included in the next full version 17.10 of Aspose.Diagram for .NET API.

@rlaskowski.sdl,

The linked ticket IDs DIAGRAMNET-51357 and DIAGRAMNET-51359 have been resolved. Please download and try the new version 17.10 of Aspose.Diagram for .NET API.