Save

WebDocument.Save 方法

保存文档输出。

public void Save()

示例

[C#]        
using (Presentation pres = new Presentation("pres.pptx"))
{
    var options = new WebDocumentOptions
    {
        TemplateEngine = new RazorTemplateEngine(),
        OutputSaver = new FileOutputSaver(),
        EmbedImages = false
    };
    
    WebDocument document = new WebDocument(options);

    // 添加 "index-template.html" 模板,并使用 "index" 模板键以便后续使用(用于输出)
    document.Input.AddTemplate<Aspose.Slides.Presentation>("index", "index-template.html");

    // 将 "index.html" 添加到输出文件,使用 "index" 模板生成,并将 pres 变量作为模型
    document.Output.Add("index.html", "index", pres);
    
    // ... 设置文档的其他选项,然后保存文档
    document.Global.Put("slideMargin", 10);
    document.Global.Put("imagesPath", "root/site/images");
    // ...
 
    document.Save();
}

另见