Microsoft Project enables us to create, organize, track, and maintain projects in MPP format. MPP file contains tasks, resources, assignments, timelines, budgets, and different other project-related information. We can easily export project data from MPP files to multi-page TIFF images programmatically. In this article, we will learn how to convert MPP to TIFF in C#.
The following topics shall be covered in this article:
- C# MPP to TIFF Converter API
- Convert MPP to TIFF
- Convert MPP to TIFF With Compression
- Remove Compression and Convert MPP to TIFF
C# MPP to TIFF Converter API
To convert MPP to TIFF, we will be using the Aspose.Tasks for .NET API. It allows reading and writing the supported file formats without requiring Microsoft Project to be installed. Moreover, it allows converting and saving MPP files.
The API provides the Project class that represents a project. The Save(string, SaveFileFormat) method of this class saves the project data to the file in a specified file format. The SaveFileFormat defines enumeration for saving project format selection. We can specify additional image save options when rendering project pages to TIFF using the ImageSaveOptions class. The TiffCompression property allows applying compression when saving generated images to the TIFF format.
Please either download the DLL of the API or install it using NuGet.
PM> Install-Package Aspose.Tasks
Convert MPP to TIFF using C#
We can easily convert the project data from the MPP file into a TIFF by following the steps given below:
- Load the MPP file using the Project class.
- Save as a TIFF using the Save() method. It takes the output TIFF file path and the SaveFileFormat as arguments.
The following sample code shows how to convert MPP to TIFF in C#.
Convert MPP to TIFF With Compression using C#
We can apply compression while converting MPP to TIFF by following the steps given below:
- Firstly, load the MPP file using the Project class.
- Next, create an instance of the ImageSaveOptions class.
- After that, specify the TiffCompression.
- Finally, call the Save() method. It takes the output TIFF file path and the SaveOptions as arguments.
The following sample code shows how to convert MPP to TIFF with compression in C#.
Remove Compression and Convert MPP to TIFF using C#
We can also remove the compression and then convert MPP to TIFF by following the steps mentioned above. However, we just need to set the TiffCompression as TiffCompression.None in step # 3.
The following sample code shows how to remove compression and convert MPP to TIFF in C#.
Get a Free License
You can get a free temporary license to try the library without evaluation limitations.
Conclusion
In this article, we have learned how to:
- load MPP file;
- specify image saving options;
- set compression for TIFF;
- save the loaded MPP as TIFF in C#.
Besides converting MPP to TIFF in C#, you can learn more about Aspose.Note for .NET API using the documentation. In case of any ambiguity, please feel free to contact us at our free support forum.