Visio diagram files can contain different types of diagrams like flow charts, organizational charts, etc. In certain use cases, you might want to review Visio files and add comments on different pages and shapes. In accordance with such use cases, this article explains how to add a comment to a VSD or VSDX Visio diagram programmatically in Java.
- Insert Comment in Visio VSD or VSDX File – Java API Installation
- How to Add a Comment in Visio Diagram in Java
- Add Comment to Visio Diagram in Java
Insert Comment in Visio VSD or VSDX File – Java API Installation
Aspose.Diagram for Java API can be used to work with Visio diagrams in VSD, VSDX, and other related file formats. Simply download the JAR file from the Downloads page or paste the following configurations in the pom.xml file to access it from Aspose Repository in your application:
Repository:
<repositories>
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>http://repository.aspose.com/repo/</url>
</repository>
</repositories>
Dependency:
<dependencies>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-diagram</artifactId>
<version>22.10</version>
</dependency>
</dependencies>
How to Add a Comment in Visio Diagram in Java
You can add comments in a Visio diagram with the following steps:
- Load the source Visio file.
- Insert a comment at the page.
- Save the output Visio diagram.
The following heading explains more details about the process along with a sample code:
Add Comment to Visio Diagram in Java
You can insert a comment to a Visio file by following the steps below:
- Create an instance of the Diagram class.
- Specify the page number to annotate it with a comment.
- Call the Save method to export the output Visio file.
The following code snippet shows how to add a comment to a Visio diagram programmatically in Java:
Get a Free API License
You can evaluate the API without any evaluation limitations by requesting a free temporary license.
Conclusion
In this article, you have learned how to add a comment in a VSD or VSDX format Visio file programmatically in Java. Whereas, you may visit the documentation space to take a look at different features covered under different chapters. In case you have any inquiries, please feel free to discuss them with us at forum.