Saving Project data to SVG format

This article shows how to render project data to SVG format using Aspose.Tasks Java.

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 shows how to achieve this using Java

1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
2// The path to the documents directory.
3String dataDir = Utils.getDataDir(SaveAsSVG.class);
4// Read the input Project file
5Project project = new Project(projectName);
6project.save(dataDir + "Project5.SVG", SaveFileFormat.SVG);

Using SvgOptions

1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
2// The path to the documents directory.
3String dataDir = Utils.getDataDir(SaveAsSVG.class);
4// Read the input Project file
5Project project = new Project(projectName);
6SaveOptions opt = new SvgOptions();
7opt.setFitContent(true);
8opt.setTimescale(Timescale.ThirdsOfMonths);
9project.save(dataDir + "FileName5.svg", opt);
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.