将Excel文件导出为HTML时从右向左扩展文本
Contents
[
Hide
]
Aspose.Cells现在支持将Excel文件中从右向左扩展的文本导出为HTML。该功能自v8.9.0.0版本已经实现。现在,如果您的源Excel文件包含从右向左扩展的文本,那么Aspose.Cells将正确地将其导出为HTML。
在将Excel文件导出为HTML时,将文本从右向左扩展
下面的示例代码将sample excel file转换成HTML。这张截图展示了示例 Excel 在 Microsoft Excel 2013 中的样子。
这张截图展示了使用较旧版本生成的output HTML。
这张截图展示了使用更新版本生成的output HTML。
正如您在屏幕截图中所看到的,新版本正确地将右对齐的文本向左扩展,就像Microsoft Excel一样。
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-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Load source excel file inside the workbook object | |
Workbook wb = new Workbook(dataDir + "sample.xlsx"); | |
// Save workbook in html format | |
wb.Save(dataDir + "ExpandTextFromRightToLeft_out_" + CellsHelper.GetVersion() + ".html", SaveFormat.Html); |