Developer's Guide

Below youll find articles on how to use Tasqize MPP to PDF in your .NET projects. This guide covers everything from setting a license and choosing timescale settings to applying text styles or specific project views.

  1. MPP to PDF Converter Overview
  2. Installation Notes
  3. FAQ
Dec 30, 2024

Subsections of Developer's Guide

MPP to PDF Converter

The Tasqize MPP to PDF Converter simplifies the creation of PDF documents from MPP files, enabling you to generate Gantt charts, resource sheets, or other project overviews in PDF form.

Key Features

  • Timescale Control: Render project timeline in Days, Weeks, or Months for the PDF output.
  • Presentation Formats: Choose from GanttChart, TaskUsage, ResourceSheet, or ResourceUsage.
  • Styling: Apply TextStyle for tasks, milestones, resources, or custom item types (e.g., OverallocatedResources, SummaryTasks).
  • Cross-Platform: Works on Windows, Linux, macOS via .NET Core / .NET 5+.

How to Convert MPP to PDF

To convert an MPP to PDF:

  1. Set the License (optional, but recommended for production):
var license = new Tasqize.License();
license.SetLicense("path/to/Tasqize.Project_to_PDF_Converter_for_.NET.lic");
  1. Create a Converter and Options:
var converter = new Tasqize.ProjectToPdfConverter();
var saveOptions = new Tasqize.PdfSaveOptions
{
    FitContent = true,                      // avoids text truncation
    Timescale = Tasqize.Timescale.Weeks,    // day, week, month, etc.
    PresentationFormat = Tasqize.PresentationFormat.ResourceSheet
};

saveOptions.TextStyles.Add(new Tasqize.TextStyle
{
    ItemType = Tasqize.TextItemType.CriticalTasks,
    Color = System.Drawing.Color.Red,
    FontStyle = Tasqize.FontStyles.Bold
});
  1. Convert the File:
converter.ConvertToPdf(
    inputFilePath: "MyPlan.mpp",
    outputFilePath: "MyPlan.pdf",
    options: saveOptions
);
  1. Check Output:
    • Ensure MyPlan.pdf was created and that it reflects your chosen timescale, presentation format, and text styling.

Advanced Configuration

  • View Settings: You can override standard presentation formats with a custom ViewSettings object if you want a named view or to enable progress lines, etc.
  • BackgroundPattern: Apply a background pattern (e.g. SolidFill) for certain text items.
  • FontStyles: Combine flags (Bold | Italic | Underline) for specific text emphasis.
  • Exception Handling:
    • FileNotFoundException if the input MPP doesnt exist.
    • InvalidOperationException if the MPP is corrupt or the conversion fails.

Example Code

using Tasqize;

var license = new License();
license.SetLicense("Tasqize.Project_to_PDF_Converter_for_.NET.lic");

var converter = new ProjectToPdfConverter();
converter.ConvertToPdf(
    "../../../example.mpp", 
    "example-output.pdf",
    new PdfSaveOptions {
        PresentationFormat = PresentationFormat.GanttChart,
        Timescale = Timescale.Days
    }
);

Console.WriteLine("Conversion complete!");

This plugin is designed for developers seeking to integrate MPP processing directly into .NET applications, eliminating the need for Microsoft Project to be installed. For more details on system requirements and non-Windows usage, see the Installation section.