Convert Microsoft Project MPP File to TIFF
Exporting Project Data to TIFF
TIFF (Tag Image File Format) is a flexible raster image format that supports multiple color depths, compression types, and even multi-page documents. It is commonly used in professional printing and document archiving scenarios.
Aspose.Tasks for .NET enables developers to export project views (such as Gantt charts) from Microsoft Project (MPP) files directly to the TIFF format.
Here is an example of the output TIFF file:
To save a project to TIFF programmatically using Aspose.Tasks for .NET:
- Load a Microsoft Project MPP file.
- Optionally make changes to the loaded project.
- Save the project to TIFF using one of Project.Save method overloads. Your can pass either SaveFileFormat.TIFF to save project with default settings or pass ImageSaveOptions to customize export options.
The following article describes properties common for all graphical formats.
Also additional options specific to TIFF format can specified. ImageSaveOptions.PixelFormat can be used to set the format of the color data for each pixel in the image. For example, Format24bppRgb specifies that the format is 24 bits per pixel; 8 bits each are used for the red, green, and blue components.
The horizontal and vertical resolution in dpi can be controlled using ImageSaveOptions.HorizontalResolution and ImageSaveOptions.VerticalResolution. ImageSaveOptions.TiffCompression can be used to specify the type of compression algorithm used when generating TIFF file.
Advanced TIFF Export Settings
For more control over the TIFF output, use the ImageSaveOptions class. This class allows you to configure key parameters such as:
Option | Description |
---|---|
PixelFormat | Defines the color depth. For example, Format24bppRgb stores 24 bits per pixel (8 bits per RGB channel). |
HorizontalResolution | Controls the horizontal resolution in dots per inch (DPI). |
VerticalResolution | Controls the vertical resolution in DPI. |
TiffCompression | Specifies the compression algorithm (e.g., None, LZW, CCITT4). |
The code example given below demonstrates how to export your project data from MPP file to TIFF.
1Project project = new Project("New Project.mpp");
2ImageSaveOptions options = new ImageSaveOptions(SaveFileFormat.TIFF);
3options.HorizontalResolution = 72;
4options.VerticalResolution = 72;
5options.PixelFormat = PixelFormat.Format24bppRgb;
6project.Save("RenderProjectDataToFormat24bppRgb_out.tif", (SaveOptions)options);
This approach allows the generation of high-quality TIFF output suitable for archiving, print, or multi-page image scenarios.