管理媒体

导出媒体文件到HTML

为了将媒体文件导出到HTML,Aspose.Slides for C++ 提供了一个简单的API来管理图表数据格式。请按照以下步骤操作:

  1. 创建一个 Presentation 类的实例。
  2. 获取幻灯片的引用。
  3. 设置过渡效果。
  4. 将演示文稿写入PPTX文件。

在下面给出的示例中,我们已将媒体文件导出为HTML。

// The path to the documents directory.
const String templatePath = u"../templates/Media File.pptx";
const String path = u"../out/";
SharedPtr<Presentation> pres = MakeObject<Presentation>(templatePath);
const String fileName = u"ExportMediaFiles_out.html";
const String baseUri = u"http://www.example.com/";
SharedPtr<VideoPlayerHtmlController> videoController = MakeObject<VideoPlayerHtmlController>(path, fileName, baseUri);
System::SharedPtr<HtmlOptions> htmlOptions = System::MakeObject<HtmlOptions>(videoController);
System::SharedPtr<SVGOptions> svgOptions = System::MakeObject<SVGOptions>(videoController);
htmlOptions->set_HtmlFormatter(HtmlFormatter::CreateCustomFormatter(videoController));
htmlOptions->set_SlideImageFormat(SlideImageFormat::Svg(svgOptions));
pres->Save(path+fileName, SaveFormat::Html, htmlOptions);