Convert Project data to SVG format

Contents
[ Hide Show ]

This article demonstrates how to render project data to SVG format using Aspose.Tasks for C++.

Saving a Project as SVG

The Project class exposes the Save method which is used to save a project in various formats. The Save method allows you to render project data to SVG format using the SaveFileFormat enumeration type.

To save a project to SVG:

  1. Load a Microsoft Project file.
  2. Save the project to SVG using SaveFileFormat.SVG.

The following lines of code demonstrate how to achieve this using C++.

1// Read the input Project file
2System::SharedPtr<Project> project = System::MakeObject<Project>(dataDir + u"CreateProject1.mpp");
3    
4// Save the Project as SVG
5project->Save(dataDir + u"SaveProjectAsSVG_out.SVG", Aspose::Tasks::Saving::SaveFileFormat::SVG);
1// Read the input Project file
2System::SharedPtr<Project> project = System::MakeObject<Project>(dataDir + u"CreateProject2.mpp");
3System::SharedPtr<SaveOptions> saveOptions = System::MakeObject<SvgOptions>();
4saveOptions->set_FitContent(true);
5saveOptions->set_Timescale(Aspose::Tasks::Visualization::Timescale::ThirdsOfMonths);
6project->Save(dataDir + u"UseSvgOptions_out.svg", saveOptions);
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.