将Excel文件导出为HTML时从右向左扩展文本

在将Excel文件导出为HTML时,将文本从右向左扩展

下面的示例代码将sample excel file转换成HTML。这张截图展示了示例 Excel 在 Microsoft Excel 2013 中的样子。

todo:image_alt_text

这张截图展示了使用较旧版本生成的output HTML

todo:image_alt_text

这张截图展示了使用更新版本生成的output HTML

todo:image_alt_text

正如您在屏幕截图中所看到的,新版本正确地将右对齐的文本向左扩展,就像Microsoft Excel一样。

from aspose.cells import CellsHelper, SaveFormat, Workbook
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# The path to the documents directory.
dataDir = RunExamples.GetDataDir(".")
# Load source excel file inside the workbook object
wb = Workbook(dataDir + "sample.xlsx")
# Save workbook in html format
wb.save(dataDir + "ExpandTextFromRightToLeft_out_" + CellsHelper.get_version() + ".html", SaveFormat.HTML)