Font issue in server while PDF generation but not in local machine

I am generating PDF from HTML. The tool which i am using for html to PDF generation is TallComponent PDFKit4.0.

When PDF is generated in server,index out of range exception is thrown. After analysis i found out due to Unicode character the issue is thrown, but with same unicode character the error is not thrown in local machine.

My question is why it is not throwing same error in my local machine but only in server. To analyze this i have compared available fonts in server and local.

In server 153 fonts are available in C:\Windows\Fonts folder. In my local machine 250 fonts are available.

I have tried to copy paste few fonts from my local to UAT server according to below link, but still it is not working.

http://www.experts-exchange.com/questions/28689512/Installing-new-TTF-font-on-Windows-Server-2012-R2.html

The below comma in one of the address filed in html file is causing the issue. The 3rd party tool is too sensitive to this font.

I have tried below sites to find out what font the comma is, https://www.myfonts.com/WhatTheFont/ and i have installed that font in server, error not solved.

I am not sure how i can narrow down the analysis to solve the issue. Since my local doesnot have problem, but server throwing error, I need to find out what is the exact cause and resolve soon as this is production bug.

Currently to resolve this issue am doing data patch in production server to update the unicode comma with normal comma. But i want to fix this permanently.

Any help would be greatly appreciated.

Answers


After long analysis, found answer myself.

Generally the problem might be related to Font missing in the server or language pack which was chosen under control panel -> region ->language.

The font Arial Unicode MS Regular was missing in our server, after installing the font and reset IIS, am able to download PDF document without any issues.

Steps taken to resolve the issue:

  • Compare how many fonts available in server and local.
  • Copy paste unicode character to Microsoft Word and check what is the font type MS word says.
  • Download that font from internet or take it from your local machine if it present.
  • Install the font and verify

To install the font just double click the font file and click install button. Drag and drop also will do the installation.

This may helpful to narrow down the issue.


Need Your Help

Getting XML data from a external page and parsing it with PHP

php xml parsing

I'm trying to create a database of World of Warcraft gems. If I go to this page:

Enable to open datepicker when id has period operator

javascript jquery datepicker

I am trying to open datepicker dialog box. For this I write inlinde code in html input control. Code looks like this