How to Convert Microsoft Project File to XPS in C#

This step by step tutorial shows you how to convert Microsoft Project file to XPS in C#. The code to convert MPP to XPS in C# can be used with any .NET application including web and desktop etc.

Steps to Convert Microsoft Project File to XPS in C#

  1. Get Aspose.Tasks for .NET API from NuGet.org
  2. Use Aspose.Tasks and Aspose.Tasks.Saving namespaces
  3. Set license with the help of SetLicense method
  4. Read input Microsoft Project (MPP) file into the Project class
  5. Save output XPS file format using SaveFileFormat

The above simple steps can easily convert MPP to XPS format in C#. The .mpp is just one Project file format, while there are other formats as well. You can convert those project file formats to XPS and other file types by following the same steps. If you’re creating your own MPP to XPS Converter in C# then this will be very helpful for you.

Code to Convert Microsoft Project File to XPS in C#

The given code sample makes it clear that the conversion from MPP to XPS can be done using a few lines of code. All you have to do is load the input Microsoft Project file and then save it to the output XPS file format. This code works on web, desktop, and windows applications. Also, it does not require Microsoft Project to be installed on the server or your local machine.

Note that we have already shared a sample to extract MPP metadata in C#. That also comes in handy when working with Microsoft Project files in C#.

 English