Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5958325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:31:37+00:00 2026-05-22T18:31:37+00:00

I wrote a PDF document, and I try to write in Hebrew (UTF-8), and

  • 0

I wrote a PDF document, and I try to write in Hebrew (UTF-8), and I can not in Windows Forms using C# and Visual Studio 2010 using the following code.

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();

I put the font in the folder.

What do I need to do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:31:37+00:00Added an answer on May 22, 2026 at 6:31 pm

    Use a PdfPTable, then you can set the right-to-left mode:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using iTextSharp.text;
    using iTextSharp.text.pdf;
    using System.IO;
    
    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
    
                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 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);
    
                    //Use a table so that we can set the text direction
                    PdfPTable T = new PdfPTable(1);
                    //Hide the table border
                    T.DefaultCell.BorderWidth = 0;
                    //Set RTL mode
                    T.RunDirection = PdfWriter.RUN_DIRECTION_RTL;
                    //Add our text
                    T.AddCell(new Phrase("מה קורה", f));
    
                    //Add table to document
                    Doc.Add(T);
    
                    //Close the PDF
                    Doc.Close();
    
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to write some (java) code that takes a PDF document, and creates
I developed a windows service to write PDF file in a directory. The service
I am using iText to write a PDF. In some cases, I need to
I'm currently using ITextSharp to write a PDF to a web browser, but I
With iText I can use Java to open a pdf and write it. If
I am using PDFsharp / MigraDoc to write tables and charts to PDF files.
I wrote a research paper in latex and generated pdf using Kile. Now I
How can I extract the title from an encrypted (write protected, not password protected)
I am using Zend_Pdf class to create a PDF document . Here the contents
I'm using iText to generate a PDF document that consists of several copies of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.