Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. aspose-com-kb revised this gist Jun 25, 2022. No changes.
  2. aspose-com-kb created this gist Jun 25, 2022.
    27 changes: 27 additions & 0 deletions How to Export MS Project to PDF using C#.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    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");
    }
    }
    }