如何在C#中使用iTextSharp的创建与泰米尔字体的PDF文件?
我们通过传递TAMIL文本(印第安语之一)。所以,我已经安装AVVAIYAR.TTF(泰米尔语字体之一)字体为我的泰米尔语font.But当我运行创造了我们的C#应用程序的PDF文件下面提到的铂族金属,创建的PDF文件不包含任何泰米尔字体display.It显示空行,而不是泰米尔文...
we are creating pdf files in our C# application by passing TAMIL text(one of the indian language).So, I already installed AVVAIYAR.TTF(one of the tamil font) font for my tamil language font.But when i run the below mentioned pgm, the created pdf file does not contain any tamil font display.It shows empty lines instead of the tamil text...
C#code:
Document document = new Document();
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(@"C:\pdfout.pdf", FileMode.Create));
document.Open();
PdfContentByte pcb = writer.DirectContent;
Font ft = new Font();
FontFactory.Register(@"C:\WINDOWS\Fonts\AVVAIYAR.TTF", "AVVAIYAR");
ft = FontFactory.GetFont("AVVAIYAR");
Paragraph pr1 = new Paragraph("இது முதல் பேரா", ft);
Paragraph pr2 = new Paragraph("This is a Sub Paragraph");
Paragraph pr3 = new Paragraph("This is the Second Paragraph");
document.Add(pr1);
document.Add(pr2);
document.Add(pr3);
document.Close();
我的输出PDF文件是:
<blank line>
This is a Sub Paragraph
This is the Second Paragraph
和我也有支持一些印第安人的语言来创建PDF文件。
And also i have to support some more indian languages to create the PDF files.
我已经把一个参考ARIALUNI.TTF.I试过这样的,
I have put a reference to ARIALUNI.TTF.I tried like this,
string fontpath = Environment.GetEnvironmentVariable("SystemRoot") + "\\fonts\\ARIALUNI.TTF";
BaseFont basefont = BaseFont.CreateFont(fontpath, BaseFont.IDENTITY_H, true);
Font font = new iTextSharp.text.Font(basefont, 24, iTextSharp.text.Font.NORMAL, iTextSharp.text.Color.BLUE);
Paragraph pr1 = new Paragraph("இது முதல் பேரா", AVVAIYARFont);
所以,现在泰米尔语字体显示在PDF file.But简约不简单的拼写错误...所以我在做一些读关于这个问题...
So, now tamil font is displayed in the pdf file.But simple simple spelling mistake... so i am doing some read on that issue...