Rendering Project Data on Predefined Page Sizes
Overview
When exporting Microsoft Project data to visual formats like images or PDF, it’s often necessary to control the physical output size of the rendered document. This is especially important when preparing reports for print, archiving, or sharing across departments.
Aspose.Tasks for .NET provides full control over this via the PageSize
enumeration in SaveOptions
. You can choose from a variety of standard paper formats, such as:
- A0, A1, A2, A3, A4 (ISO sizes commonly used in Europe)
- Letter, Ledger (North American standards)
These settings allow you to precisely tailor the output for large wall charts, compact printouts, or digital documentation.
Supported Views for Rendering
The following views can be rendered using predefined page sizes:
- Gantt Chart
- Task Usage
- Resource Usage
- Resource Sheet
These can be set using the PresentationFormat
property in SaveOptions
.
Setting Page Size and Rendering
To use a predefined page size:
- Create an instance of
ImageSaveOptions
orPdfSaveOptions
. - Set the
PageSize
property to the desired value. - Set the
PresentationFormat
to the view you want (e.g.,GanttChart
,TaskUsage
). - Save the file to disk.
Example: Export Project to A1-Sized Gantt Chart Image
1Project project = new Project("New Project.mpp");
2
3// Render the project to all Pre-Defined page sizes
4foreach (PageSize pageSize in (PageSize[])Enum.GetValues(typeof(PageSize)))
5{
6 PdfSaveOptions options = new PdfSaveOptions();
7 options.PresentationFormat = PresentationFormat.GanttChart;
8 options.FitContent = true;
9 options.PageSize = pageSize;
10 project.Save("PredefinedPageSizes_" + pageSize.ToString() + "_out.pdf", (SaveOptions)options);
11}
Notes and Recommendations
- The output layout depends not only on
PageSize
but also on timescale, number of tasks, and selected columns. Make sure to adjust those settings for best results. - When rendering to image formats, consider using lossless compression (like TIFF with LZW) to maintain readability on large sheets.
- For very large projects, A0 or Ledger formats are recommended to avoid data truncation.
Summary
Using Aspose.Tasks for .NET, you can render project data to a variety of predefined page sizes, suitable for printing or digital distribution. This feature simplifies document generation and ensures consistent formatting across various output targets.