将 Excel 中的文档工作簿和工作表属性导出到 HTML 转换
Contents
[
Hide
]
可能的使用场景
当使用 Microsoft Excel 或 Aspose.Cells 将 Microsoft Excel 文件导出到 HTML 时,它还会导出各种类型的文档、工作簿和工作表属性,如下面的屏幕截图所示。您可以通过设置HtmlSaveOptions.ExportDocumentProperties, HtmlSaveOptions.ExportWorkbookProperties和HtmlSaveOptions.ExportWorksheetProperties作为错误的.这些属性的默认值为真的.以下屏幕截图显示了这些属性在导出的 HTML 中的样子。
将 Excel 中的文档、工作簿和工作表属性导出到 HTML 转换
下面的示例代码加载示例 Excel 文件并将其转换为 HTML 并且不导出文档、工作簿和工作表属性输出 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-Java | |
//Load the sample Excel file | |
Workbook workbook = new Workbook("sampleExportDocumentWorkbookAndWorksheetPropertiesInHTML.xlsx"); | |
//Specify Html Save Options | |
HtmlSaveOptions options = new HtmlSaveOptions(); | |
//We do not want to export document, workbook and worksheet properties | |
options.setExportDocumentProperties(false); | |
options.setExportWorkbookProperties(false); | |
options.setExportWorksheetProperties(false); | |
//Export the Excel file to Html with Html Save Options | |
workbook.save("outputExportDocumentWorkbookAndWorksheetPropertiesInHTML.html", options); |