SaveAsPDF Problem with Persian Fonts

Hello,

I have problem with the files that have texts with persian fonts like “B Traffic”. when saving these files to pdf using Aspose.Cells they become like squares. I have attached the font so please check and tell me what to do.

I guess this is not about Persian fonts. This problem happens when font has space character inside its name like “B Traffic”.

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

Please download and try the latest version Aspose.Cells
for .NET v7.5.1.3
and see if it works fine.

If your problem still occurs, please provide us your source file which you are converting to pdf. We will look into it and help you asap.

The Problem still occurs. I’ve attached two files and a sample code. In the first post I’d attached font file.


Aspose.Cells.Workbook wb = new Workbook(“d:\test.xlsx”);
wb.Save(“d:\test.pdf”, FileFormatType.Pdf);

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

Your issue is due to missing font. Please set the font directory and create the pdf. Please see the following code that illustrates how to set font directory.

C#


string filepath = @“F:\Shak-Data-RW\Downloads\test.xlsx”;


//Set the font directory

CellsHelper.FontDir = “C:\WINDOWS\Fonts”;


Workbook workbook = new Workbook(filepath);

workbook.Save(filepath + “.out.pdf”, SaveFormat.Pdf);


I did what you said and the Problem still occurs. Your attached pdf output has wrong font probably "Arial". If you use my font "B Traffic" (ie. install it first and then run the program) you will see that problem still occurs.

Hi,


Thanks for providing us template files with font file.

After an initial test, I observed the issue as you have mentioned. I installed your provided font file “B Traffic” first and then converted the template file to PDF and found the issue as you pointed out. I have logged a ticket with an id “CELLSNET-41898” for your issue. We will look into it to figure it out soon.

Thank you.

Hi,

Thanks for using Aspose.Cells for .NET.

Please download and try this fix: Aspose.Cells for .NET v7.7.0.4 and let us know your feedback.

The problem still exists. You can see the difference of produced PDF files using Aspose.Cells and Ms Excel.

Hi,

Thanks for your feedback and using Aspose.Cells.

You are right. The issue is still occurring with the latest fix i.e (v7.7.0.4). I have attached the source test file, Excel and Aspose output pdf for a reference. I have also reopened this issue and logged your comment in our database. We will look into it again and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.