3
C#을 사용하여 아랍어로 PDF를 만들 때이 코드를 사용하면 생성 된 PDF 파일에 개별 문자가 포함됩니다. 어떤 도움이라도 나는 연속적인 캐릭터를 얻을 수 없습니까?itextsharp에서 아랍어 인코딩
//Create our document object
Document Doc = new Document(PageSize.LETTER);
//Create our file stream
using (FileStream fs = new FileStream(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "Test.pdf"), FileMode.Create, FileAccess.Write, FileShare.Read))
{
//Bind PDF writer to document and stream
PdfWriter writer = PdfWriter.GetInstance(Doc, fs);
//Open document for writing
Doc.Open();
//Add a page
Doc.NewPage();
//Full path to the Unicode Arial file
string ARIALUNI_TFF = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts), "arabtype.TTF");
//Create a base font object making sure to specify IDENTITY-H
BaseFont bf = BaseFont.CreateFont(ARIALUNI_TFF, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
//Create a specific font object
iTextSharp.text.Font f = new iTextSharp.text.Font(bf, 12, iTextSharp.text.Font.NORMAL);
//Write some text, the last character is 0x0278 - LATIN SMALL LETTER PHI
Doc.Add(new Phrase("This is a ميسو ɸ", f));
//Write some more text, the last character is 0x0682 - ARABIC LETTER HAH WITH TWO DOTS VERTICAL ABOVE
Doc.Add(new Phrase("Hello\u0682", f));
//Close the PDF
Doc.Close();
}
나는이 직면 한 : 이제 테이블에 예를 들어, 아랍어 텍스트를 추가 할 수 있습니다
:
은 어떤 경우에, 당신은 아랍어 문자 모양을 표시하는 방법을 알고있는 폰트를 필요 문제가되기 전에, 당신은 내 질문에 "아랍어 변환"유니 코드 "itextsharp를 사용하여 pdf에 콘텐츠 HTML 또는 XML을"당신을 도울 수 있습니다 http://stackoverflow.com/questions/16080741/convert-arabicunicode-content-html- 또는 -xml-to-pdf-using-itextsharp –