ITextSharp Error: ARIALUNI.TTF not found as file or resource in hosting server

Last Reply 28 days ago By dharmendr

Posted 29 days ago

Error on server

C:\Windows\Fonts\ARIALUNI.TTF not found as file or resource.

BaseFont bf = BaseFont.CreateFont(Environment.GetEnvironmentVariable("windir") + @"\fonts\ARIALUNI.TTF", BaseFont.IDENTITY_H, true);

error comes in this line

You are viewing reply posted by: dharmendr 28 days ago.
Posted 28 days ago

Hi IamAzhar,

The font file is not available in the hosting server.

So copy the ARIALUNI.TTF file and save in project folder. Then select the file from the project folder.

string fontPath = Server.MapPath("~/Fonts/");
BaseFont bf = BaseFont.CreateFont(fontPath + "ARIALUNI.ttf", BaseFont.IDENTITY_H, true);

For more details refer below link.

https://stackoverflow.com/questions/22728381/itextsharp-arialuni-ttf-copy-on-hosting-server