Header Footer Visio csharp

Headers and footers are used to display information over the top and bottom margin of each page of a file. They can include the topic, chapter, author, page number, and other relevant information. Visio diagrams in VSD or VSDX format can also contain a header and footer to show important information. This article covers how to insert or remove the header and footer in Visio files programmatically in C#.

Manipulate Header and Footer in VSD/VSDX Diagram File – C# API Installation

You can create, edit, or manipulate Visio files in VSD, VSDX, and several other file formats. For working with the header and footer section in Visio diagrams, you need to download the DLL file of Aspose.Diagram for .NET from the Downloads section, or run the following NuGet installation commands:

PM> Install-Package Aspose.Diagram

Insert Header and Footer in Visio Diagram File Programmatically in C#

You can insert or add the header and footer in a Visio diagram file by following the steps below:

  1. Initialize an instance of the Diagram class to load the input VSD or VSDX Visio file.
  2. Set different properties of the HeaderFooter class.
  3. Save the output Visio diagram.

The following code snippet demonstrates how to insert or add a header and footer in a VSD or VSDX diagram programmatically in C#:

The screenshot below shows a sample Visio file after inserting the header and footer in a VSD/VSDX diagram file:

Header Footer Visio

Remove Header and Footer in Visio File in C#

You can remove or delete the header and footer from a Visio diagram with the following steps:

  1. Create an object of the Diagram class to load the input Visio file.
  2. Access different properties of the HeaderFooter classes and clear the properties.
  3. Save the output Visio file after removing the header and footer.

The code snippet below shows how to remove or delete the header and footer from a Visio file in C#:

Get a Free API License

You can evaluate the API in its full capacity by getting a free temporary license.

Conclusion

In this article, you have learned how to insert or remove the header and footer from a Visio diagram in VSD or VSDX file format programmatically in C#. Furthermore, you may visit the documentation section to learn various other features offered by the API. Please contact us at the forum in case of any concerns or queries.

See Also

Convert Visio VSD or VSDX to XAML in C#