Create Visio document programmatically
Contents
[
Hide
]
Creating a New Visio Drawing
Aspose.Diagram for .NET lets you read and create Microsoft Visio diagrams from within your own applications, without Microsoft Office Automation. The first step when creating new documents, is to create a diagram. Then add shapes and connectors to build up the diagram.
Create Visio Drawing Programming Sample
The code below shows to create a new Microsoft Visio drawing. Please note that the blank drawing contains a single empty page.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-diagram/Aspose.Diagram-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir_LoadSaveConvert(); | |
// Initialize a Diagram class | |
Diagram diagram = new Diagram(); | |
// Save diagram in the VSDX format | |
diagram.Save(dataDir + "CreateNewVisio_out.vsdx", SaveFileFormat.VSDX); |
The drawing paper size is Letter by default.