Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aspose-com-kb/7290fed08357ac1b0460b27a53ede581 to your computer and use it in GitHub Desktop.
Save aspose-com-kb/7290fed08357ac1b0460b27a53ede581 to your computer and use it in GitHub Desktop.
How to Export MS Project to PDF using C#. For more information, please follow the link: https://kb.aspose.com/tasks/net/how-to-export-ms-project-to-pdf-in-csharp/
using Aspose.Tasks;
using Aspose.Tasks.Saving;
namespace AsposeTests
{
class Program
{
static void Main(string[] args) // Main function to Convert MPP to PDF
{
// Load license
Aspose.Tasks.License lic = new Aspose.Tasks.License();
lic.SetLicense(@"Aspose.Total.lic");
// Load the source MPP file
Project project = new Project("Sample.mpp");
// Declare the PdfSaveOptions class object and set page size
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.PageSize = Aspose.Tasks.Visualization.PageSize.A0;
// Convert MPP to PDF
project.Save("output.pdf", pdfSaveOptions);
System.Console.WriteLine("Done");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment