Printing Project Files

To print a Project’s pages to separate output files, use the ImageSaveOptions.SaveToSeparateFiles property. It specifies whether to save pages to separate files or not. Additionally, the API provides the ImageSaveOptions.Pages property that contains a list of page numbers to save when exporting project layouts. If the list is empty and SaveToSeparateFiles is set to true, all pages will be saved as separate image files.

Printing Project Pages to Separate Files

The following example demonstrates how to export Microsoft Project pages into separate image files. This approach is useful when you need to process or share specific project pages independently rather than as a single large image.

 1Project project = new Project("New Project.mpp");
 2ImageSaveOptions options = new ImageSaveOptions(SaveFileFormat.PNG);
 3options.StartDate = project.Get(Prj.StartDate).AddDays(-3);
 4options.EndDate = project.Get(Prj.FinishDate);
 5
 6options.MarkCriticalTasks = true;
 7options.LegendOnEachPage = false;
 8
 9options.Gridlines = new List<Gridline>();
10
11Gridline gridline = new Gridline();
12gridline.GridlineType = GridlineType.GanttRow;
13gridline.Color = Color.CornflowerBlue;
14gridline.Pattern = LinePattern.Dashed;
15options.Gridlines.Add(gridline);
16 
17// Save the whole project layout to one file
18project.Save("PrintProjectPagesToSeparateFiles1_out.png", (SaveOptions)options);
19
20// Save project layout to separate files
21options.SaveToSeparateFiles = true;
22project.Save("PrintProjectPagesToSeparateFiles2_out.png", (SaveOptions)options);

In this code snippet, the ImageSaveOptions class is configured to enable page separation. Each project page is saved into an individual image file, making the output easier to manage, view, and print. This method is especially helpful for large projects where splitting pages improves readability and performance.

Conclusion

Printing Microsoft Project pages into separate image files with Aspose.Tasks for .NET allows developers to gain more control over how project data is shared and presented. By using ImageSaveOptions.SaveToSeparateFiles, you can easily generate page-by-page outputs, simplify distribution, and ensure that stakeholders only receive the relevant portions of a project. This feature is an efficient way to manage project visualization at scale and integrate project data into external workflows.

FAQ

Q: Do I need Microsoft Project installed to export pages to images?

Q: Can I export only specific pages of a project file?

Q: Which image formats are supported when printing project pages?

Q: Is it possible to export all project pages at once into separate files?

Q: Does this feature work only with MPP files?

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.