通过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-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(RenderUnicodeSupplimentaryCharacterToPDF.class); | |
// Load your source excel file containing Unicode Supplementary | |
// characters | |
Workbook wb = new Workbook(dataDir + "unicode-supplementary-characters.xlsx"); | |
// Save the workbook | |
wb.save(dataDir + "output.pdf"); |