This brief tutorial describes how to convert MPP to HTML in C# by loading the source MPP file and then providing the option to configure the output HTML file. During the configuration, you can set a variety of characteristics of the HTML file according to your requirements. Once the configuration is done, the Project.Save() function will be used to transform Microsoft Project to HTML using C#.
Steps to Convert Microsoft Project to HTML using C#
- Configure the project to use Aspose.Tasks into the application
- Load the source MPP file into the Project class object to convert to HTML
- Create an instance of HtmlSaveOptions to configure the output HTML file
- Specify the page numbers that should be rendered to the HTML
- Set the page size of the HTML file
- Save the MPP file as HTML using the above configurations
These steps assist to change MPP to HTML in C# by providing information about the necessary library and classes. It is not necessary to set a special configuration in the HtmlSaveOptions class if you want to convert all the pages to HTML otherwise, you can add the desired page numbers to the HtmlSaveOptions.Pages collection. Similarly, if you do not set page size explicitly, the default page size will be used.
Code to Convert MPP to HTML in C#
In this code to change Microsoft Project to HTML using C# HtmlSaveOptions class object is used that contains properties to set bar styles, default font name, end date to finish the rendering to, set the line in the Gridlines and set SaveFormat to name a few. You can save the output file not only as HTML but to other formats also using other overloaded save functions.
In this article, we have learned to convert MPP to HTML however if you want to convert a Microsoft project file to XPS refer to the article on how to convert Microsoft Project file to XPS in C#.