Microsoft Project Files are used to organize and manage different tasks in a project. You can convert MPP files to PDF programmatically using C#. You can find several options for the conversion in the following headings:
- MPP to PDF Conversion – C# API Installation
- Convert MPP to PDF Programmatically using C#
- MPP to Multiple Pages PDF Conversion in C#
- Convert MPP to Password Protected and Encrypted PDF File in C#
MPP to PDF Conversion – C# API Installation
Aspose.Tasks for .NET API support working with Microsoft Project files. You can easily install the API by downloading the DLL file from New Releases section, or via NuGet Package Manager with the following installation command:
PM> Install-Package Aspose.Tasks
Convert MPP to PDF Programmatically using C#
You can convert MPP file to PDF documents with the following steps:
- Load input Project file (MPP).
- Export the output PDF file with Save() method.
The code below shows how to convert MPP file to PDF programmatically using C#:
MPP to Multiple Pages PDF Conversion in C#
Sometimes you might need to convert different pages of an MPP file to separate PDF files. You can follow the steps below for converting a Project file to multiple pages:
- Load input MPP (Microsoft Project) file with Project class.
- Initialize PdfSaveOptions class object.
- Set SaveToSeparateFiles property to true.
- Specify the page numbers to export.
- Save the output PDF file.
The following code demonstrates how you can convert MPP file to multiple PDF files programmatically in C#:
Convert MPP to Password Protected and Encrypted PDF File in C#
MPP files can contain sensitive information about a project so you may need to share it only with authorized users. You can convert MPP file to an encrypted and password-protected PDF file with the following steps:
- Load input (MPP) Project file.
- Initialize PdfEncryptionDetails class object.
- Set permissions for the output PDF file.
- Initialize PdfSaveOptions class object.
- Save the output PDF file.
The code sample below explains how to convert MPP file to a password protected and encrypted PDF file using C#:
Get Free API License
You can evaluate the API in its full capacity by requesting a Free Temporary License.
Conclusion
In conclusion, you have learned how to convert an MPP file to PDF document programmatically using C#. Moreover, you have explored different features like encryption and password protection for the output PDF file. You may visit API Documentation to explore several other features offered by the API. In case you have some different requirements or want to discuss any concerns about your POC with the API, please feel free to contact us via the Free Support Forum. We will be glad to assist you.