在保存为HTML时禁用导出框架脚本和文档属性
Contents
[
Hide
]
在将工作簿转换为HTML时,Aspose.Cells会导出框架脚本和文档属性。Aspose.Cells for .NET的8.6.0版本引入了一个选项,允许您选择是否禁用导出框架脚本和文档属性。请使用HtmlSaveOptions.ExportFrameScriptsAndProperties属性来禁用导出。
禁用导出框架脚本和文档属性
以下示例代码允许您禁用导出框架脚本和文档属性。一旦您将工作簿转换为HTML,输出文件将不包含任何框架脚本和文档属性。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Open the required workbook to convert | |
Workbook w = new Workbook(dataDir + "Sample1.xlsx"); | |
// Disable exporting frame scripts and document properties | |
HtmlSaveOptions options = new HtmlSaveOptions(); | |
options.ExportFrameScriptsAndProperties = false; | |
// Save workbook as HTML | |
w.Save(dataDir + "output.out.html", options); |