导出Excel文件为HTML时导出注释
Contents
[
Hide
]
在将 Excel 文件保存为 HTML 时导出批注
将Excel转为HTML时不会导出批注。Aspose.Cells for Python via Java提供了在将Excel转为HTML期间导出批注的功能。要实现此功能,API提供了HtmlSaveOptions.IsExportComments属性。将HtmlSaveOptions.IsExportComments属性的值设置为True将会在输出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) |