Hi!

I tried to create PDFs in hungarian language therefore it contains
characters such as ő (\u0151) or ű(\u071). These characters are not
displayed in the resulting PDF.

I created a snippet, which tries to add such characters to the
document. Am i doing it wrong?

public static void main(String[] args) {
                System.out.println("Start");
                Document document = new Document(PageSize.A4, 50, 50, 50, 50);
        try {
                // step 2
            PdfWriter.getInstance(document, new
FileOutputStream("encoding.pdf"));
            // step 3
            document.open();
            // step 4
            String text = "Árvíztűrő tükörfúrógép .\u0150\u0151\u0170\u0171.";
            document.add(new Paragraph(text,
FontFactory.getFont(FontFactory.TIMES, 10, Font.NORMAL)));
        }
        catch (Exception de) {
            de.printStackTrace();
        }
        // step 5
        document.close();
        System.out.println("Done.");
}

I tried to use third-party ttf (and otf) font files, thinking that
maybe the built-in font files does not contain these characters. The
font files are loaded and used perfectly, except the mentioned
characters. Could someone help me solving the problem?

Thanks

Balage;

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to