Simplified Arabic fonts is not rendered properly in exported PDF

Hi..
I am using Aspose Cell to convert XLSX/XLS/ODS to PDF. The excel has Simplified Arabic fonts (my machine also has Simplified Font included in font directory). But it seems that, while converting it to PDF the fonts are changed. PFA is the sample input and output documents.


Hi Dhawal,


Thank you for contacting Aspose support.

I have checked your provided PDF and have noticed that correct font (Simplified Arabic) has been embedded in it. Could you please clarify, why do you think that correct font is not being used to render the text? Moreover, your PDF was generated with Aspose.Pdf for Java 11.0.0, and not with Aspose.Cells for Java API. Please share an executable sample application along with the said font file (TTF/TTC) and environment details for investigation.
Hi,
Sorry for the confusion..
The document was converted using Aspose Cell After converting I was using Aspose PDF to add watermark hence it says Aspose PDF as produce. Anyways I have attached the Output file converted using only Aspose Cell.

I have used two version of Aspose Cell 8.2.0 and 8.8.1. Also, I have attached a PDF which is converted using MS Office 2013. In the document, There are 2 rows which have Arabic content. one has Simplified Arabic Font and one has Arial font. you can see the difference in the output PDFs. It looks like the file converted using Aspose cell have same font on both the row.

Also i have attached the font files of my system.

Following is the code


Workbook lWorkbook = new Workbook("D:/Sample.xlsx");
for(int i =0;i<lWorkbook.getWorksheets().getCount();i++)
{
Worksheet lWorksheet = lWorkbook.getWorksheets().get(i);
lWorksheet.getPageSetup().setPrintGridlines(true);
lWorksheet.getPageSetup().setPrintHeadings(true);
lWorksheet.getPageSetup().setPrintComments(PrintCommentsType.PRINT_IN_PLACE);
}
PdfSaveOptions lPdfSaveOptions = new PdfSaveOptions(SaveFormat.PDF);
lPdfSaveOptions.setAllColumnsInOnePagePerSheet(true);
lWorkbook.save("D:/Sample.pdf",lPdfSaveOptions);

Hi,

Thanks for your posting and using Aspose.Cells.

In non-Windows environment like Linux, Ubuntu, CentOS and sometimes in Windows environment too, you have to first set font directory.

Please place all of your required fonts in some directory and then specify the directory path via the CellsHelper.setFontDir() method.

Please see the following sample code that will give you a clue how to deal with this problem.

Please also see the following articles for your more help.

( http://www.aspose.com/docs/display/cellsjava/Aspose.Cells+Font+Usage )

Java

//First set the font director path where you have placed the needed fonts
// CellsHelper.setFontDir(“c:\temp\fonts”);
CellsHelper.setFontDir(“/usr/temp/fonts”);

Workbook wb = new Workbook(“sample.xlsx”);
wb.save(“out.pdf”);

Hi,

I already tried it, but no success. Are you able to convert the given XLSX file into PDF file with proper fonts?

Hi Dhawal,


Thank you for the feedback.

We have evaluated the presented scenario on Windows 10 x64 by installing your provided fonts to the default font directory. We have noticed that regardless of the fact that the fonts are available for the API, they are not being embedded in the resultant PDF. This incident needs to be investigated by the product team therefore we have logged it as CELLSJAVA-41849. Please spare us little time for the proper analysis and get back to you with updates in this regard.