Manage Media

Export Media File to HTML

In order to export media filAspose.Slides for C++ provides a simple API for managing chart data formaes to HTML. Please follow the steps below:

  1. Create an instance of Presentation class.
  2. Get reference of the slide.
  3. Setting the transition effect.
  4. Write the presentation as a PPTX file.

In the example given below, we have exported the media files to 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);