Header and footer sections are commonly used to show important information about a document. In some cases, you may need to insert or delete a header or footer in Visio files. This article covers how to insert or remove header and footer in VSD or VSDX files programmatically in Java.
- Insert or Delete Header and Footer in Visio Diagrams – Java API Installation
- Insert Header and Footer in VSD or VSDX File Programmatically in Java
- Delete Header and Footer from VSD VSDX Diagram File in Java
Insert or Delete Header and Footer in Visio Diagrams – Java API Installation
Aspose.Diagram for Java API can be used to work with different features of Visio diagram files. You can easily configure it by downloading its JAR files from the New Releases section, or access it from Aspose Repository using the following details in the pom.xml file of your project:
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.4</version>
<classifier>jdk16</classifier>
</dependency>
</dependencies>
Insert Header and Footer in VSD or VSDX File Programmatically in Java
You can insert or add a header and footer in a VSD or VSDX Visio file by following the steps below:
- Create an instance of the Diagram class to load the source file.
- Set different properties exposed by the HeaderFooter class.
- Save the output Visio file.
The following code sample shows how to insert the header and footer into a Visio Diagram file in VSD or VSDX format programmatically in Java:
The screenshot below is showing a sample file after inserting the header and footer with the above code snippet:
Delete Header and Footer from VSD VSDX Diagram File in Java
You can delete or remove the header and footer in a VSD or VSDX Diagram file with the following steps:
- Initialize an object of the Diagram class to load the input Visio file.
- Remove the header and footer then save the output VSD/VSDX Diagram.
The following code snippet shows how to delete the header and footer from a VSD VSDX drawing programmatically in Java:
Get a Free License
You can evaluate the API without any limitations by getting a free temporary license.
Conclusion
In this article, you have learned how to insert or delete header and footer from Visio diagram files in VSD or VSDX format programmatically in Java. However, you can learn many other features of the API by visiting the documentation. Please contact us at the forum in case of any concerns or ambiguity.