Your First Aspose.Diagram Application - Hello World
Contents
[
Hide
]
This tutorial shows how to create a very first application (Hello World) using Aspose.Diagram' simple API. This simple application creates a Microsoft Visio file with the text ‘Hello World’ in a specified Page.
Creating the Hello World Application
The steps below creates the Hello World application using the Aspose.Diagram API:
- Create an instance of the Diagram class.
- If you have a license, then apply it. If you are using the evaluation version, skip the license related code lines.
- Create a new Visio file, or open an existing Visio file.
- Create a new text box.
- Insert the words Hello World! into a text box.
- Generate the modified Microsoft Visio file.
The implementation of the above steps is demonstrated in the examples below.
Code Sample: Creating a New Diagram
The following example creates a new diagram from the scratch, writes Hello World! on the first page and saves the Visio file.
Code Sample: Opening an Existing File
The following example opens an existing Microsoft Visio template file named “Sample.vsdx”, inputs “Hello World!” text in the first page and saves the diagram.