Konvertieren Sie Microsoft Project MPP -Datei
In diesem Artikel wird beschrieben, wie Microsoft -Projekt -MPP -Dateien in verschiedene Ausgabedateien konvertiert werden können, einschließlich HTML, einfacher Text und Microsoft -Projektvorlage (MPT) unter Verwendung von asspose.tasks für .NET. Die API bietet eine umfassende Funktion zum Anpassen der Ausgabe, einschließlich Ressourcenhandhabung, Headereinstellungen, Stylingoptionen und Inhaltsfilterung. Jedes Format ist mit praktischen Beispielen und optionalen Anpassungsschritten behandelt.
Mit Microsoft Project (MSP) können Entwickler Projektdaten (MPP/XML) in HTML-, Text- und MPT -Vorlagen speichern. Mit Aspose.Tasks können Sie auch Projektdaten in denselben Formaten sparen, die MSP ähneln. Dies wird unter Verwendung der Standard -Save -Methode erreicht, die vom Projekt Klasse aufgedeckt wurde.
Projektdaten als html speichern
Mit der HTMLSaveOptions -Klasse können Entwickler das Layout und den Inhalt exportierter HTML -Dateien steuern. Es unterstützt mehrseitige Export-, Seitengrößenkonfiguration, Zeitskala-Auswahl und Einbettung oder Externalisierung von CSS, Schriftarten und Bildern. Aspose.Tasks können Projektdaten in das HTML -Format exportieren. Es ermöglicht, alle Daten in HTML zu speichern oder nur die erforderlichen Seiten in HTML zu exportieren, indem die in den folgenden Code -Beispiele gezeigten Speicheroptionen verwendet werden.
Controlling Header and Title Output in HTML
By default, the exported HTML document includes the project name in the HTML <title>
and in the document’s page header. You can disable either of these elements by modifying the corresponding properties of the HtmlSaveOptions
class.
Saving Fonts, Images and CSS Styles Separately
Aspose.Tasks supports saving fonts, images, and CSS styles as external files. This is particularly useful when you want to integrate HTML output into an existing website or manage styling separately from the content. This is achieved using the HtmlSaveOptions class by providing information about CSS, Font and Image destinations. The resource export behavior can be configured through HtmlSaveOptions.ExportFonts, ExportImages, and ExportCss.
Adding Custom Prefixes to CSS Class Names While Exporting to HTML
To avoid CSS class name conflicts when integrating the exported HTML into a broader application, you can define a custom prefix using the CssStylePrefix
property.
Save Project to Text
Project data can be exported to plain text using SaveFileFormat.TXT
. This format is intended for simple logging, debugging, or archival purposes.
Save Project Data as Template (MPT)
Aspose.Tasks allows saving a project as a Microsoft Project Template (MPT) file. This is useful when you want to create reusable project structures. Use the SaveAsTemplate
method and configure optional parameters through the SaveTemplateOptions
class to remove actual and baseline values.
Conclusion
Aspose.Tasks for .NET provides flexible and developer-friendly methods for exporting project data to multiple formats, including HTML, text, and templates. With the help of configuration classes such as HtmlSaveOptions and SaveTemplateOptions, developers can fine-tune the output to meet a wide range of business requirements. For additional details, refer to the API Reference or explore other export scenarios in the documentation.