导出媒体文件为HTML文件
Contents
[
Hide
]
为将媒体文件导出为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);
}