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