Excel 到 HTML - 使用 PresentationPreference 选项以获得更好的布局
Contents
[
Hide
]
Aspose.Cells 提供了一个有用的属性,HtmlSaveOptions.PresentationPreference ,当将 Microsoft Excel 文件保存为 HTML 或 MHT 格式时,开发人员可以使用它来获得更好的布局。该属性的默认值为错误的.我们建议将此属性设置为真的从 Excel 报告中获得更好看的演示文稿。
This file contains hidden or 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 | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(ExceltoHTMLPresentationPreferenceOption.class); | |
// Instantiate the Workbook | |
// Load an Excel file | |
Workbook workbook = new Workbook(dataDir + "HiddenCol.xlsx"); | |
// Create HtmlSaveOptions object | |
HtmlSaveOptions options = new HtmlSaveOptions(); | |
// Set the Presenation preference option | |
options.setPresentationPreference(true); | |
// Save the Excel file to HTML with specified option | |
workbook.save(dataDir + "outPresentationlayout1.html"); |
您可能会发现以下有关 Excel 到 HTML 转换的文章很有帮助