保存到 HTML 时禁用下层显示评论
Contents
[
Hide
]
保存到 HTML 时禁用下层显示评论
当 Excel 文件转换为 HTML 时,Aspose.Cells 在输出 HTML 文件中添加 Downlevel-revealed 条件注释。这些条件注释主要与旧版本的 Internet Explorer 有关,与现代浏览器无关。有关 Downlevel-revealed 条件注释的更多信息,请访问以下链接
要删除 Downlevel-revealed 条件注释,Aspose.Cells 提供了HtmlSaveOptions.DisableDownlevelRevealedComments财产。设定HtmlSaveOptions.DisableDownlevelRevealedComments财产给真的将删除输出 HTML 文件中的 Downlevel-revealed 条件注释。
下图显示了将在输出 HTML 文件中删除的 Downlevel-revealed 条件注释
示例代码
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
source_directory = "Examples/SampleFiles/SourceDirectory/" | |
output_directory = "Examples/SampleFiles/OutputDirectory/" | |
# Load the Sample Workbook | |
workbook = Workbook(source_directory + "sampleDisableDownlevelRevealedComments.xlsx") | |
# Initialize HtmlSaveOptions | |
saveOptions = HtmlSaveOptions() | |
# Disable DisableDownlevelRevealedComments | |
saveOptions.setDisableDownlevelRevealedComments(True) | |
# Save the excel file. | |
workbook.save(output_directory + "outputDisableDownlevelRevealedComments_true.html", saveOptions) |