Microsoft Project (MPP) files are used to track, organize and manage projects. These files contain tasks, assignments, and other project-related resources and information. If you want to share project information with someone and they do not have MS Project installed, you can convert the MPP file to images like PNG, JPEG, BMP, and TIFF and share those. To that end, this article will teach you how to convert Microsoft Project MPP files to images programmatically using C#.
- C# API for Converting MPP Files to Images
- Convert MPP Files to JPEG Format using C#
- Converting MPP Files to PNG Images using C#
- Convert MPP Files to BMP Images using C#
- Convert MPP Files to Multipage TIFF using C#
C# API for Converting MPP Files to Images
Aspose.Tasks for .NET is a .NET library that allows you to read and write MPP/XML files without requiring Microsoft Project to be installed. Furthermore, the API supports converting MPP files to images. You can either install the API through NuGet or download it directly from the Downloads section.
PM> Install-Package Aspose.Tasks
Convert MPP Files to JPEG Format using C#
The following are the steps to convert MPP files to JPEG format using C#.
- Load the MPP file using the Project class.
- Create an instance of the ImageSaveOptions class using the SaveFileFormat.JPEG enumeration.
- Specify the quality of the JPEG image using the JpegQuality property of the ImageSaveOptions class.
- Save the JPEG image using the Project.Save(string filename, SaveOptions options) method.
The following sample code shows how to convert an MPP file to JPEG images using C#.
Converting MPP Files to PNG Images using C#
In order to convert an MPP file to PNG images, follow the steps given below.
- Load the MPP file using the Project class.
- Create an instance of the ImageSaveOptions class using the SaveFileFormat.PNG enumeration.
- Save the PNG image using the Project.Save(string filename, SaveOptions options) method.
The following sample code shows how to convert an MPP file to PNG images using C#.
Convert MPP Files to BMP Images using C#
The following are the steps to convert an MPP file to BMP images using C#.
- Load the MPP file using the Project class.
- Create an instance of the ImageSaveOptions class using the SaveFileFormat.BMP enumeration.
- Save the BMP image using the Project.Save(string filename, SaveOptions options) method.
The following sample code shows how to convert an MPP file to BMP images using C#.
Convert MPP Files to Multipage TIFF using C#
The following are the steps to convert an MPP file to a multipage TIFF using C#.
- Load the MPP file using the Project class.
- Create an instance of the ImageSaveOptions class using the SaveFileFormat.TIFF enumeration.
- Save the TIFF image using the Project.Save(string filename, SaveOptions options) method.
The following sample code shows how to convert an MPP file to a multipage TIFF image using C#
Get a Free License
In order to try the API without evaluation limitations, you can request a free temporary license.
Conclusion
In this article, you have learned how to convert Microsoft Project MPP files to image format using C#. Specifically, you have learned how to convert MPP files to JPEG, PNG, BMP, and TIFF image formats using Aspose.Tasks for .NET API. The API provides a bunch of additional features for working with MPP files that you can explore in detail by visiting the official documentation. In case of any questions, please feel free to reach us at our free support forum.