Saving Project data to SVG format
Contents
[
Hide
Show
]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:
- Load a Microsoft Project file.
- 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);