Export Special Characters to PDF using iTextSharp in ASP.Net

Last Reply 6 months ago By dharmendr

Posted 6 months ago

Hi all, by using below url i exported special characters like ∩, ∑, ∫, ∆ gridview data to pdf.

http://www.aspsnippets.com/Articles/Export-ASPNet-GridView-Arabic-Persian-or-Urdu-Language-Characters-to-PDF-using-iTextSharp.aspx

 

my requirement is

some special characters like ∈ not exported AND

instead of

 

 

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

i want to use(my requirement)

 

BaseFont bf = BaseFont.CreateFont(Environment.GetEnvironmentVariable("windir") + @"\fonts\Times New Roman.ttf", BaseFont.IDENTITY_H, true);

but at runtime i get the error "Times-New-Roman" not found, but in my "windir" i have "Times New Roman.ttf" in font folder.

if any body understand my problem please help me.

Thanks in Advance

Results 1 - 5 of 8 12
Posted 6 months ago
Hi @nagaraju60,
Please try the following

iTextSharp Export Hindi Characters to PDF using C# ASP.Net

It might help you.

Cheers Andrea.

Posted 6 months ago
Andrea says:
Hi @nagaraju60,
Please try the following

iTextSharp Export Hindi Characters to PDF using C# ASP.Net

It might help you.

Cheers Andrea.

 

Its not working for my requirement


Posted 6 months ago Modified on 6 months ago

Times New Roman Working after changing name "Times New Roman.ttf" to 

"Times.ttf"

 

 

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

 

but i am not export the special character like "∈"..

Can any one help me please


Posted 6 months ago

Hi nagaraju60,

In font folder under arial there is multiple ttf files available. From that arial.ttf is one. You can simply check the ttf file name by right clicking on the file and open the property you get the ttf file name in general tab.

Like that Times New Roman has multiple ttf files(timesbd.ttf, timesbi.ttf, timesi.ttf, times.ttf). You can use these four font. That why you are getting the error "Times New Roman" not found. Because there is no ttf file with the name Times New Roman.


Posted 6 months ago
dharmendr says:

Hi nagaraju60,

In font folder under arial there is multiple ttf files available. From that arial.ttf is one. You can simply check the ttf file name by right clicking on the file and open the property you get the ttf file name in general tab.

Like that Times New Roman has multiple ttf files(timesbd.ttf, timesbi.ttf, timesi.ttf, times.ttf). You can use these four font. That why you are getting the error "Times New Roman" not found. Because there is no ttf file with the name Times New Roman.

 dear dharmendr ,

               Thanks for reply, i got the solution for font format. some special characters like "∈" not exported to pdf file. it is the main problem. could please tell me how to solve it.

I agree, here is the link: http://e-iceblue.com/free-api