When I entered a character with a “Variation Selectors” in Aspose Cells and saved it as a PDF, the characters were garbled. Is there any solution?
Could you please share your sample code using Aspose.Cells and sample files (input file (if any) and output PDF) to reproduce the issue, we will check it soon.
Share below. thank you.
Sample Code
public static void Main(string[] args)
{
//LicenseLoad();
MemoryStream pdfStream = new MemoryStream();
Workbook wb = new Workbook();
Worksheet ws = wb.Worksheets[0];
ws.Cells[0, 0].Value = "榊󠄀";// \u8de5\ue0100
wb.Save(pdfStream, SaveFormat.Pdf);
File.WriteAllBytes("out.pdf", pdfStream.GetBuffer());
}
PDF Result
image.png (661 Bytes)
out.pdf (12.5 KB)
Supplement
The display contents may differ depending on the environment, so supplement with images.
image.png (8.8 KB)
Thanks for the screenshots and sample.
Please notice, after an initial test, I am able to reproduce the issue as you mentioned by using. I found the characters specified in the Variation Selectors (Variation Selectors (Unicode block) - Wikipedia) are garbled when rendering to PDF. I have logged a ticket with an id “CELLSNET-52349” for your issue. We will look into it soon.
Once we have an update on it, we will let you know.
We are pleased to inform you that your issue (logged earlier as “CELLSNET-58804”) has been resolved. The fix/enhancement will be included in an upcoming release (Aspose.Cells v25.8) that we plan to release either this weekend or during the next week of August 2025. You will be notified when the next version is released.
Please note: A font that supports Variation Selectors needs to be set.
public static void Main(string[] args)
{
//LicenseLoad();
MemoryStream pdfStream = new MemoryStream();
Workbook wb = new Workbook();
Worksheet ws = wb.Worksheets[0];
ws.Cells[0, 0].Value = "榊󠄀";// \u8de5\ue0100
//Set a font that supports Variation Selectors
StyleFlag styleFlag = new StyleFlag();
styleFlag.FontName = true;
Style style = wb.CreateStyle();
style.Font.Name = "MS PGothic";
ws.Cells[0, 0].SetStyle(style, styleFlag);
wb.Save(pdfStream, SaveFormat.Pdf);
File.WriteAllBytes("out.pdf", pdfStream.GetBuffer());
}
The issues you have found earlier (filed as CELLSNET-52349) have been fixed in this update. This message was posted using Bugs notification tool by leoluo