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

Free Support Forum - aspose.com

Document font corruption in Excel to PDF rendering

When you upload the attached document to the system, the font of the document is corrupted as in the attachment.
Font test has been done in Windows Server 2019 standard edition and the problem persists.
YG15253_AsposeTestProjectCell.zip (2.7 MB)

@srmbimser,
I have tried this scenario but could not observe this issue. Could you please share a comparison image for our reference? Here is the comparison of output with the source file that is created at our end.
original_doc_Wind.pdf (48.0 KB)
Comparison.jpg (499.7 KB)

Attached is the screenshot and the corrupted file.
ss.PNG (168.6 KB)
converttopdf.pdf (53.4 KB)

@srmbimser,
I can not reproduce the issue. Please make sure Arial font is installed in your environment and then share your feedback.

@srmbimser

First, make sure the used “Arial Tur” font is installed.
If “Arial Tur” font is not installed, Aspose.Cells will do font substitutes, you can specify font subsitutes with following code:

FontConfigs.SetFontSubstitutes("Arial Tur", new string[] { "Arial" });

Workbook wb = new Workbook("original_doc.xls");

wb.Save("output.pdf");

Bold “VAGRounded BT” font is used in the Excell title area. When the document is viewed in pdf format with aspose, it is seen that the title font is in a thin and different font.
The relevant area is marked in the screenshot.
ss.PNG (180.8 KB)

@srmbimser,
We are working on this issue and need the output PDF file generated in your environment for our reference. Could you please share your output PDF here? Also share “VAGRounded BT” font that is used at your end.

PDF output and font file are attached
YG15352_font.zip (80.4 KB)

@srmbimser,
Thank you for sharing the font. We will use it while analyzing the issue.

@srmbimser

Bold “VAGRounded BT” font is used in the Excell title area. When the document is viewed in pdf format with aspose, it is seen that the title font is in a thin and different font.

I checked your shared font file, it is “Vag DB” font, instead of “VAGRounded BT” font used in the source file. Actually, on my end, Microsoft Excel uses “Arial” font if “VAGRounded BT” font is not installed.
You can use the following code to let Aspose.Cells uses “Arial” font if “VAGRounded BT” font is not installed.
FontConfigs.SetFontSubstitutes("VAGRounded BT", new string[] { "Arial" });

Also, if “Arial Tur” font is also not installed on your side, please add the following code as we had shared:
FontConfigs.SetFontSubstitutes("Arial Tur", new string[] { "Arial" });

So, the code will be:

FontConfigs.SetFontSubstitutes("VAGRounded BT", new string[] { "Arial" });
FontConfigs.SetFontSubstitutes("Arial Tur", new string[] { "Arial" });

Workbook wb = new Workbook("original_doc.xls");
wb.Save("output.pdf");

The server has the font “VAGRounded BT”. Making the font “arial” doesn’t solve our problem. The customer wants the produced output to be in the same font.

As we told you earlier, the font you shared with us is “Vag DB” font instead of “VAGRounded BT”. So, if this font is installed on your server (which you are thinking of “VAGRounded BT” font), it will of no use. So, kindly install VAGRounded BT (.ttf file(s)) on the server first and then try your scenario/case. Also, share your true “VAGRounded BT” font with us.

Could you share your output PDF file and comparison screenshot (comparing input file Vs output PDF) to highlight the issue. We will check it soon. Also, make sure that the following lines should be pasted as first lines of your program (i.e., before using any other Aspose.Cells APIs)

We updated the font files again and tested the scenario. The error persists. The font files we used, the original document, the .pdf document created with MS excell, the .pdf document created with aspose.cell 21.8 and screenshots are attached.
YG15352.zip (625.4 KB)

@srmbimser,

I first installed all your fonts to my pc (Windows8) and then try the following sample code to render your template file to PDF, it works fine. Even the result is better than what you provided by MS Excel renderer. The main reason still remains the same, i.e., the relevant fonts, e.g. “VAGRounded BT” are not installed on your server machine:.
e.g.
Sample code:

Workbook workbook = new Workbook("e:\\test2\\original_doc.xls");
workbook.Save("e:\\test2\\out1.pdf");

Please font attached the output PDF for your reference.

The other reason (of your issue) might be Aspose.Cells library could not access the fonts folder which contains the font “VAGRounded BT” and other relevant fonts. Also, see the screenshot (attached) which is taken when viewing the output PDF into acrobat reader using "File|Properties"option. You can clearly see the underlying font is used. I could not spot this font when viewing your provided PDF files.
out1.pdf (69.4 KB)
sc_shot1.png (64.9 KB)

PS. by the way, could you try your scenario/case on some other (development) machine (after you have installing the fonts there) if you still see the same issue?