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

Last Reply one month ago By dharmendr

Posted one month 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

Posted one month 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