将 Excel 文件保存到 HTML 时导出注释
Contents
[
Hide
]
将 Excel 文件保存到 HTML 时导出注释
Excel 转换为 HTML 时,不导出注释。 Aspose.Cells for Python via Java 提供Excel转HTML时导出注释的功能。为此,API 提供了HtmlSaveOptions.IsExportComments财产。设定值HtmlSaveOptions.IsExportComments财产给真的将在输出 HTML 中导出注释。
以下屏幕截图显示了示例代码片段生成的输出文件 HTML。
以下示例代码演示了在 Excel 到 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
source_directory = "Examples/SampleFiles/SourceDirectory/" | |
output_directory = "Examples/SampleFiles/OutputDirectory/" | |
# Load the Sample Workbook | |
workbook = Workbook(source_directory + "sampleExportCommentsHTML.xlsx") | |
# Initialize HtmlSaveOptions | |
saveOptions = HtmlSaveOptions() | |
saveOptions.setExportComments(True) | |
# Save the excel file. | |
workbook.save(output_directory + "outputExportCommentsHTML.html", saveOptions) |