在保存为HTML时禁用旧版条件注释的显示
可能的使用场景
当将Excel文件保存为HTML时,Aspose.Cells会显示Downlevel Conditional Comments。这些条件注释大多与旧版本的Internet Explorer相关,并与现代Web浏览器无关。您可以在以下链接中详细了解它们。
Aspose.Cells允许您通过将HtmlSaveOptions.DisableDownlevelRevealedComments属性设置为true来消除这些Downlevel Revealed Comments。
在保存为HTML时禁用下级可见的批注
以下示例代码显示了HtmlSaveOptions.DisableDownlevelRevealedComments属性的用法。当其未设置为true时,截图显示了此属性的效果。请下载此代码中使用的sample Excel file和由其生成的output HTML文件以供参考。
示例代码
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// Load sample workbook | |
Workbook wb = new Workbook(srcDir + "sampleDisableDownlevelRevealedComments.xlsx"); | |
// Disable DisableDownlevelRevealedComments | |
HtmlSaveOptions opts = new HtmlSaveOptions(); | |
opts.setDisableDownlevelRevealedComments(true); | |
// Save the workbook in html | |
wb.save(outDir + "outputDisableDownlevelRevealedComments_true.html", opts); |