We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Save as PDF with Unicode 8209 Non-breaking Hyphen (U+2011)

I have noticed this issue using Aspose Cells version 8.3.0.0 and version 8.3.0.4. The below code creates an Aspose Cells PDF document. The two cells are formatted with the Times New Roman font, but when I add Unicode Character (decimal) 8209 - Non-Breaking Hyphen the font changes to Arial or something. The attached file shows the example output.


Dim BOOK = New Aspose.Cells.Workbook
Dim SHEET = BOOK.Worksheets(0)
Dim CELL_1 = SHEET.Cells(0, 0)
Dim CELL_2 = SHEET.Cells(0, 1)
Dim STYLE_1 = CELL_1.GetStyle()
Dim STYLE_2 = CELL_2.GetStyle()
STYLE_1.Font.Name = "Times New Roman"
CELL_1.SetStyle(STYLE_1)
CELL_2.SetStyle(STYLE_1)

CELL_1.PutValue("Hello")
CELL_2.PutValue("Hello" & ChrW(8209))
BOOK.Save("C:\TEMP\Test.pdf", Aspose.Cells.SaveFormat.Pdf)

Hi Tom,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue after executing your code with the latest version: Aspose.Cells for .NET 8.3.1. Adding Unicode (decimal) 8209 Character changes the font to Arial.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43233 - Adding Unicode (decimal) 8209 Character changes the font to Arial

Hi Tom,

Thanks for using Aspose.Cells.

We have looked into this issue further and found that for the Cell2, the font “Time New Roman” can not show the Unicode 8209d character, so while converting to pdf, we will find a font that we have got to show the character.

When I change the one unicode character in the cell to use the Unicode font "MS Mincho", I get the desired result, as attached.

CELL_2.PutValue("Hello" & ChrW(8209))
CELL_2.Characters(5, 1).Font.Name = "MS Mincho"
BOOK.Save("C:\TEMP\Test.pdf", Aspose.Cells.SaveFormat.Pdf)

Is it possible to change the font on just the specific unicode characters that cannot be displayed using the cell's default font?

Hi Tom,

Thanks for your feedback and using Aspose.Cells.

Almost all characters can be displayed fine with Arial Unicode font. Regarding your requirement, we think it will not be feasible because it will affect the performance of Aspose.Cells.

However, we have logged your comment in our database so that we could investigate and evaluate your requirement and advise you. Please spare us some time. Once, there is some news for you, we will let you know asap.

I appreciate your having logged this to the database. I have worked around this issue by using the above code to investigate each character in a cell and change its font manually before saving as a PDF document.

I understand that the Arial Unicode font has glyphs from the supplementary multilingual planes. I am trying to use a Serif font, and changing the entire cell to a Sans-Serif font is jarring to the visual look of the report.

The PDF conversion procedure already checks for these extended unicode characters. Once it finds the first unicode character in a cell, it changes the cell's font and goes onto the next cell. The extra performance cost of accurately fixing only the needed characters will probably be negligible since the PDF conversion process is expected to take a while when writing to disk anyway.

Thank you for your consideration.

Hi Tom,

Thanks for your posting and using Aspose.Cells.

After initial investigation, we think, we can implement such a feature therefore we have logged a New Feature request to implement and support this feature in our database.

We will investigate it and fix this issue. Once, the feature is implemented or we have some other update for you, we will let you know asap. Besides, we have also logged your comment against this issue for development team consideration.

This issue has been logged as

  • CELLSNET-43240 - Change the font on just the specific unicode characters that cannot be displayed using the cell’s default font

Hi,

Thanks for using Aspose.Cells.

We have fixed this issue.

  • CELLSNET-43240 - Change the font on just the specific unicode characters that cannot be displayed using the cell’s default font

Please download and try the latest version: Aspose.Cells
for Java v8.3.1.1
and let us know your feedback.

The specific version I am working on is Aspose Cells for .NET.

Hi,


Sorry for the inconvenience,

Please try our latest version/fix: Aspose.Cells for .NET v8.3.1.1

Thank you.

Hi,

Thanks for using Aspose.Cells.

Please try the following code with the latest version: Aspose.Cells for .NET v8.3.1.2.

C#
Workbook wb = new Workbook(srcFile);
PdfSaveOptions options = new PdfSaveOptions();
options.IsFontSubstitutionCharGranularity = true;
wb.Save(outFile.pdf, options);

The issues you have found earlier (filed as CELLSNET-43240) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.