Dear all,

Now I want to display Khmer Unicode in iText and the range of Khmer Unicode
from 1780 to 17FF.
I can display Khmer Unicode in iText by using these code as below:

public class UnicodeExamplePDF {

    public static void main(String[] args) {
        Document document = new Document();

        try {
            PdfWriter writer = PdfWriter.getInstance(document, new
FileOutputStream("UnicodeExamplePDF.pdf"));
            document.open();

            BaseFont bfComic = BaseFont.createFont("D:/Kh Content.ttf",
BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
            document.add(new Paragraph("Unicode:
បង្រៀនភាសារខ្មែរទៅកាន់ពិភពបច្ចេកវិទ្យា......", new Font(bfComic, 12)));
            ColumnText columnText = new
ColumnText(writer.getDirectContent());
            columnText.setRunDirection(PdfWriter.RUN_DIRECTION_LTR);
            columnText.addElement(new Paragraph("Unicode:
បង្រៀនភាសារខ្មែរទៅកាន់ពិភពបច្ចេកវិទ្យា......", new Font(bfComic, 12)));
        } catch (Exception e) {
            System.err.println(e.getMessage());
        }
        document.close();
    }
}

And I got incorrect display as what I have expected.
http://itext-general.2136553.n4.nabble.com/file/n3815030/incorrect.png 

and here is and expected result
http://itext-general.2136553.n4.nabble.com/file/n3815030/correct.png 


--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Khmer-Unicode-support-in-iText-tp3815030p3815030.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
iText-questions mailing list
[email protected]
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