Mediendateien in HTML-Datei exportieren

Um Mediendateien nach HTML zu exportieren, befolgen Sie bitte die folgenden Schritte:

  • Erstellen Sie eine Instanz der Klasse Presentation
  • Holen Sie sich eine Referenz auf die Folie
  • Legen Sie den Übergangseffekt fest
  • Speichern Sie die Präsentation als PPTX-Datei

Im nachstehenden Beispiel haben wir die Mediendateien nach HTML exportiert.

Beispiel


 //Loading a presentation

using (Presentation pres = new Presentation("example.pptx"))

{

   const string path = "path";

   const string fileName = "video.html";

   const string baseUri = "http://www.example.com/";

   VideoPlayerHtmlController controller = new VideoPlayerHtmlController(path: path, fileName: fileName, baseUri: baseUri);

   //Setting HTML options

   HtmlOptions htmlOptions = new HtmlOptions(controller);

   SVGOptions svgOptions = new SVGOptions(controller);

   htmlOptions.HtmlFormatter = HtmlFormatter.CreateCustomFormatter(controller);

   htmlOptions.SlideImageFormat = SlideImageFormat.Svg(svgOptions);

   //Saving the file

   pres.Save(path + fileName, SaveFormat.Html, htmlOptions);

}

Laufendes Beispiel herunterladen

Beispielcode herunterladen