HTML ファイルへのメディア ファイルのエクスポート

メディア ファイルを HTML にエクスポートするには、以下の手順に従ってください:

  • Presentation クラスのインスタンスを作成します
  • スライドの参照を取得します
  • トランジション効果を設定します
  • プレゼンテーションを PPTX ファイルとして書き出します

以下の例では、メディア ファイルを HTML にエクスポートしています。


 //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);

}

実行サンプルのダウンロード

サンプルコードのダウンロード