The logic used to set the code to Arial Unicode MS is there below -

str is an arabic string that comes from a database.

  BaseFont bfArialUni =
                BaseFont.createFont("C:\\Windows\\Fonts" + "\\ARIALUNI.TTF",
                                    BaseFont.IDENTITY_H,
BaseFont.EMBEDDED);
        Font fontArialUni = new Font(bfArialUni,12f);
        Phrase myPhrase = new Phrase(str,fontArialUni);

            PdfPTable table = new PdfPTable(1);
            PdfPCell cell = new PdfPCell(new Paragraph(myPhrase));
            cell.setColspan(3);
            cell.setPaddingRight(15f);
            cell.setBorder(PdfPCell.NO_BORDER);
            cell.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);

            table.addCell(cell);
            document.add(table);

This code is not setting the arabic characters to arial unicode MS font.

On Fri, Jul 27, 2012 at 2:22 PM, Paulo Soares <pgpsoa...@gmail.com> wrote:

> How the hell do I know what's going on? Did you show us your code? Are
> we all psychic to guess what you are doing?
>
> iText does what it's told to do. You are doing something wrong but
> didn't bother to tell us about your code.
>
> Paulo
>
> On Fri, Jul 27, 2012 at 3:30 AM, Harsha Kaundinya <hsk.1...@gmail.com>
> wrote:
> > Then how can i achieve converting arabic characters to arial unicode MS
> > font? Because i am setting one font for the entire string and only
> english
> > characters are setting to Arial Unicode MS while arabic are being set to
> > times new roman font.
> >
> > Harsha
> >
> >
> > On Thu, Jul 26, 2012 at 10:51 PM, Paulo Soares <pgpsoa...@gmail.com>
> wrote:
> >>
> >> That's the way it works with the code you are using.
> >>
> >> Paulo
> >>
> >> On Thu, Jul 26, 2012 at 4:53 PM, Harsha Kaundinya <hsk.1...@gmail.com>
> >> wrote:
> >> > HI,
> >> >
> >> > I am facing a problem while assigning Arial MS Unicode Font to Arabic
> >> > Characters. Once the PDF is generated all the Arabic words are in
> >> > TimesNewRoman Font. If there are any other english numbers or
> characters
> >> > along with the Arabic characters, then they are set to Arial MS
> Unicode
> >> > Font. Why are Arabic Characters are not setting to Arial MS Unicode
> >> > Font?
> >> >
> >> > I am actually adding a paragraph to a PdfPCell and setting the run
> >> > direction
> >> > to RTL in case of Arabic and Hebrew. Arabic fonts are differing while
> >> > its
> >> > getting printed on to the iText PDF.
> >> >
> >> > Is there someone who can help me on this???
> >> >
> >> > Thank you.
> >> > Harsha
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> iText(R) is a registered trademark of 1T3XT BVBA.
> Many questions posted to this list can (and will) be answered with a
> reference to the iText book: http://www.itextpdf.com/book/
> Please check the keywords list before you ask for examples:
> http://itextpdf.com/themes/keywords.php
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to