プロジェクトデータをSVG形式に保存します

この記事では、Aspose.Tasks Javaを使用してプロジェクトデータをSVG形式にレンダリングする方法を示しています。

SVGとしてプロジェクトを保存

プロジェクトクラスは、プロジェクトをさまざまな形式で保存するために使用される保存方法を公開します。保存方法により、SaveFileFormat Enumerationタイプを使用して、プロジェクトデータをSVG形式にレンダリングできます。

プロジェクトをSVGに保存するには:

  1. Microsoftプロジェクトファイルをロードします。
  2. SaveFileFormat.svgを使用して、プロジェクトをSVGに保存します。

次のコード行は、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.