Rendering as PDF doesn't show custom TrueType fonts

Hi,


we have an incident at a customer that they don’t see the TrueType fonts in pdf output
after rendering an Excel workbook.

But with Word to PDF and same fonts it works perfectly.

Additionally we were not able to reproduce it on our side with same fonts.
used Aspose.Cells version: 8.1.0.0
used Aspose.PDF version: 8.3.0.0

We have restarted the server several times.

Do you have any hint what can be the issue ?

Kind regards

Hi Hristo,


Thank you for contacting Aspose support.

As per your problem description, it seems that the issue is related to the availability of the TrueType fonts in the environment where conversion process is taking place. Anyway, in order to troubleshoot your presented scenario further, please provide us the following details.

  • Platform (.NET/Java)
  • Operating system details of your customer & yours
  • In case the platform is Java, please mention the JDK version & type being used in both environments
  • In case the platform is .NET, please mention the target .NET Framework
  • Source spreadsheet
  • Resultant PDF files generated in both environments
Hi Babar,

Plattform .NET 4.5.1
OS: Windows Server 2008 R2

I have to ask the customer if I can forward their custom fonts.
But anyway it works on my PC and in my virtual machine.
And it works with Word2PDF (Aspose.Words) with SAME fonts.
But not with Excel2PDF (Aspose.PDF and Aspose.Cells).

Kind regard,
Guido
Hi Babar,

Plattform .NET 4.5.1
OS: Windows Server 2008 R2

I have to ask the customer if I can forward their custom fonts.
But anyway it works on my PC and in my virtual machine.
And it works with Word2PDF (Aspose.Words) with SAME fonts.
But not with Excel2PDF (Aspose.PDF and Aspose.Cells).

Kind regard,
Hristo

Hi Babar,


is there a similar function in .NET C# to follwowing hint ?
Get Warnings for Font Substitution while Rendering Excel File|Documentation

Kind regards,
Hristo

Hi Guido & Hristo,


Thank you for sharing the environment details. However, the information is still not enough to properly investigate the matter on our end. We require the a sample spreadsheet along with PDF files generated in both environments (where scenario works and where it does not). Also if the spreadsheet is using some uncommon fonts then it would be of great help if you can share the font files as well.

Please note, Aspose.Cells APIs work more or less in the same manner as of Aspose.Words, that is; Aspose.Cells APIs require the TrueType fonts (TTF files) used in the spreadsheet to be present in the environment for rendering process. In case the required fonts are not present (or Aspose.Cells APIs are not able to find them), the APIs will try to substitute the required font with the one available. In case no TrueType fonts are present/found, the API will simulate the Arial font and renders all contents using the Arial font. Moreover, Aspose.Cells APIs tries to find the required fonts in the system’s font folder unless the font folder path is explicitly specified using the CellsHelper.SetFontDir method at the start of the application. It is quite possible that the problematic machine either does not have the TTFs or they not present at the location where the API is looking for them. In such case, it is advised to place the required fonts on the machine and point the API to the TTFs using the CellsHelper.SetFontDir method. Please try this approach on the customer’s machine and see if you are able to resolve the problem. You may also give a try to the latest version of Aspose.Cells for .NET 8.4.0 without making any source code changes.

But not with Excel2PDF (Aspose.PDF and Aspose.Cells).

Regarding your comments as quoted above, are your further processing the Aspose.Cells generated PDF files with Aspose.Pdf APIs? I am sure you are aware that Aspose.Cells does not require any other component/APIs for spreadsheet to PDF conversion. If you are experiencing similar issues with Aspose.Pdf then it would be appropriate to open a new case in Aspose.Pdf support forum with relevant details.

Hi,

hmitov:

is there a similar function in .NET C# to follwowing hint ?
http://www.aspose.com/docs/display/cellsjava/Get+Warnings+for+Font+Substitution+while+Rendering+Excel+File


Yes, we have similar APIs in .NET as well, see the document for your reference:
http://www.aspose.com/docs/display/cellsnet/Get+Warnings+for+Font+Substitution+while+Rendering+Excel+File

Thank you.

Hi again,

hmitov:
is there a similar function in .NET C# to follwowing hint ?
http://www.aspose.com/docs/display/cellsjava/Get+Warnings+for+Font+Substitution+while+Rendering+Excel+File

Yes, the same feature is available in Aspose.Cells for .NET API. Please check the following link for the details and source code snippet.


Please note, this feature was supported starting from Aspose.Cells for .NET 8.1.2. As you are using 8.1.0 so you will not be able to use it unless you upgrade the API.

Hi Babar,


we found two workarounds:

Setting FontDir explicity to “c:\windows\fonts” works.
Using Aspose.Cells Version 8.3.2.5 works, too.

Customer and me thought about Windows Security updates or similar which
prevents Aspose.Cells Version 8.1.0.0 to get fonts from Standard folder automatically.

Do you have another idea ?

Kind regards,
Guido

Hi Guido,


It is good to know that you are able to resolve the issue. As per your comments, the problem does not replicate while using the v8.3.2.5 (and without explicitly setting the font directory) it seems that problem is a bug in v8.1.0.0 that could have been triggered due to some updates, which are not yet installed on your machine. That could be the reason you are getting correct results with v8.1.0.0 so far.

Hi,


It is possible that you fix this issue coming up with Windows update KB3013455 ?
The customer has installed this version since his last successful creation.
Here I found a hint that it could lead to a font corruption: Redirecting

Kind regards,
Guido

Hi Guido,


As you have mentioned that the problematic behavior was first reported after Windows update then the problem could have been triggered due it, however, I am unable to find any reference of the said update in the release notes of the recent revisions of Aspose.Cells APIs. I will further discuss the matter with the product team to get an insight of what could have fixed the mentioned issue, and update you here once I have some news.