Hebräischer Text im PDFC#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Hebräischer Text im PDF

Post by Anonymous »

Ich habe ein PDF-Dokument geschrieben und versuche, auf Hebräisch (UTF-8) zu schreiben. In Windows Forms mit C# und Visual Studio 2010 kann ich den folgenden Code nicht verwenden.

Code: Select all

Document Doc = new Document(PageSize.LETTER);

//Create our file stream
using (FileStream fs = new FileStream("C:\\Users\\moshe\\Desktop\\Test18.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("C:\\Users\\moshe\\Desktop\\proj\\gold\\fop\\gold", "ARIAL.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);

//Write some text
Doc.Add(new Phrase("מה קורה", f));

//Write some more text
Doc.Add(new Phrase("תודה לכולם", f));

//Close the PDF
Doc.Close();
Ich habe die Schriftart in den Ordner gelegt.

Was muss ich tun?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post