使用Aspose.Cells for Python via .NET API,将输出PDF中的Unicode补充字符渲染。
Contents
[
Hide
]
普通的Unicode字符为2字节长,而Unicode补充字符为4字节长。Aspose.Cells for Python via .NET现在支持渲染这些4字节Unicode字符。
在Unicode字符标准中,补充字符是指分配的代码点范围从U+10000到U+10FFFF。换句话说,这些是大于U+FFFF的Unicode字符。
- 在UTF-8中,这些字符每个都是4个字节长。
- 在UTF-16中,这些字符需要2个代理对(16位单位)。
使用Aspose.Cells for Python via .NET将输出PDF中的Unicode补充字符渲染
以下屏幕截图显示了Aspose.Cells for Python via .NET如何将源Excel文件渲染为输出PDF。如您所见,所有三个Unicode补充字符的渲染方式与Microsoft 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
from aspose.cells import 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 your source excel file containing Unicode Supplementary characters | |
wb = Workbook(dataDir + "unicode-supplementary-characters.xlsx") | |
# Save the workbook | |
wb.save(dataDir + "RenderUnicodeInOutput_out.pdf") |