Global
WebDocument.Global 属性
返回文档的全局存储。只读 Storage
。
public Storage Global { get; }
示例
使用此 Global
属性(Storage
接口的实现),可以在模板中使用属性:
[C#]
var options = new WebDocumentOptions
{
TemplateEngine = new RazorTemplateEngine(),
OutputSaver = new FileOutputSaver(),
EmbedImages = false
};
WebDocument document = new WebDocument(options);
// 从模板中使用 "slideMargin" 属性
document.Global.Put("slideMargin", 10);
// ... 设置文档的其他选项,然后保存文档
document.Save();