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

Free Support Forum - aspose.com

Some special symbols are not displaying correctly in converted PDF from excel using ASPOSE

Dear Aspose Support team,


We are using Aspose to generate PDF from Microsoft Excel.

In the Java code, we have the following lines to display the direction symbols and they perfctly showing in the generated excel report where as in PDF we have the issue -The symbols are not correctly decoded, instead of the symbols shown in excel , they are shown different ones as shown below.

Java code:
cell.get(startRowNum, startColNum+3).setValue(“↓↓”);
if(fprofile.getTrend().equals(“Double Sided Arrow”))
cell.get(startRowNum, startColNum+3).setValue(“:left_right_arrow:”);

Can you please help us understand the root cause of this or any other way doing this. Any samples would be really appreciated to achieve this piece of functionality.

Regards
Esha

Hi Esha,


Thank you for contacting Aspose support.

We have evaluated your presented scenario while using the latest version of Aspose.Cells for Java 8.3.2.3 and the following piece of simple code.

Java

Workbook book = new Workbook();

book.getWorksheets().get(0).getCells().get(“A1”).setValue(“↓↓”);
book.getWorksheets().get(0).getCells().get(“A2”).setValue(“↔”);

book.save(“D:/output.pdf”, SaveFormat.PDF);

Unfortunately, we are unable to replicate the problem as you may also observe from the attached resultant PDF. We would recommend you to please give a try to the latest version (link shared above). In case the problem persists, we need your environment details such as follow to further investigate the matter.

  • Operating system version
  • Operating system architecture
  • System’s locale/region
  • JDK type (Sun’s/OpenJDK)
  • JDK version

Thanks for the response.


Does this scenario dependent on Operating system. We are experience this issue in Linux environment.

we are using Aspose.cells for java version 8.1.2 .



Regards
Esha

Hi Esha,

Thanks for your posting and using Aspose.Cells.

It is actually the issue of Fonts. You need Arial MT (simply Arial) font. Just get it from your Windows Fonts directory and place it in your Linux Machine in some directory.

Suppose, you place it in /usr/share/fonts/mydir then you will have to set it with CellsHelper.setFontDir() like this

CellsHelper.setFontDir("/usr/share/fonts/mydir")

Now Aspose.Cells will use the fonts in this directory while converting your Excel into PDF and your symbols will properly be converted.

Please also see this post for your more help.

( Save in PDF does not display UTF-8 characters )