Wie man MPP in SVG umwandelt

Skalierbare Vektorgrafiken (SVG) ist ein XML-basiertes Vektorbildformat, das zweidimensionale Grafiken unterstützt. Es wird aufgrund seiner Skalierbarkeit und hohen Auflösung in Web- und Druckumgebungen häufig verwendet.

Aspose.Tasks für .NET unterstützt die vollständige Unterstützung für das Exportieren von Microsoft Project (MPP) -Dateien in das SVG -Format. Diese Funktion ermöglicht es Entwicklern, Projektansichten wie Gantt -Diagramme in eigenständige Grafik von Vektor umzusetzen. Diese Grafiken können dann in Webanwendungen, Berichte oder ohne Qualitätsverlust eingebettet werden.

Ein Projekt speichern als SVG

Die Projekt Klasse enthält die Speichernmethode, mit der ein Projekt in verschiedenen Formaten speichert wird. Mit der Speichernmethode können Sie Projektdaten mit dem SaveFileFirformat -Aufzählungstyp in das SVG -Format rendern.

Um ein Projekt auf SVG zu speichern:

  1. Laden Sie eine Microsoft -Projektdatei.
  2. Speichern Sie das Projekt in SVG mit SaveFileformat.svg.

Die folgenden Codezeilen zeigen, wie dies mit C#erreicht werden kann.

1Project project = new Project("New Project.mpp");
2project.Save("SaveProjectAsSVG_out.SVG", SaveFileFormat.SVG);
1Project project = new Project("New Project.mpp");
2SaveOptions options = new SvgOptions();
3options.FitContent = true;
4options.Timescale = Timescale.ThirdsOfMonths;
5project.Save("UseSvgOptions_out.svg", options);

Using SvgOptions to Customize Output

The SvgOptions class allows you to customize how the output SVG is rendered. For example, you can specify which pages to render or change the output timescale.

Key properties include:

Conclusion

Aspose.Tasks for .NET makes it easy to convert Microsoft Project files into high-quality vector graphics. The SVG format is ideal for scenarios where scalable and embeddable visualizations are required. For more control over the output, use the SvgOptions class to fine-tune rendering behavior.

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.