public static void main(String[] args) {
Document document = null;
try {
char s ='\u0434';
System.out.println("Encodings");
// step 1: creation of a document-object
document = new Document();
// step 2: creation of the writer
//PdfWriter.getInstance(document, new FileOutputStream("/usr/IBMHttpServer/htdocs/fontencoding.pdf"));
PdfWriter.getInstance(document, new FileOutputStream("C:\\fontencoding.pdf"));
// step 3: we open the document
document.open();
// step 4: we add content to the document
//BaseFont courier = BaseFont.createFont("/usr/lpp/X11/lib/X11/fonts/COUR.TTF", "CP1251", false);
BaseFont courier = BaseFont.createFont("c:\\winnt\\fonts\\COUR.TTF", "CP1251",false);
String[] codePages = courier.getCodePagesSupported();
System.out.println("All available encodings:");
for (int i = 0; i < codePages.length; i++) {
System.out.println(codePages[i]);
}
String names[][] = courier.getFullFontName();
System.out.println("\nListing the full font name:\n");
for (int k = 0; k < names.length; ++k) {
for (int i = 0; i < names[k].length; i++) {
System.out.print(names[k][i] + " ");
}
System.out.println();
}
if(courier.charExists(s))
System.out.println("Char bu fontda mevcut");
else
System.out.println("nasıl yani");
Font font = new Font(courier, 12, Font.NORMAL);
Chunk chunk = new Chunk("<a\u0434a>", font);
document.add(chunk);
}
catch(DocumentException de) {
System.err.println(de.getMessage());
}
catch(IOException ioe) {
System.err.println(ioe.getMessage());
} catch (Exception e){
e.printStackTrace();
} finally{
// step 5: we close the document
document.close();
}
}

Bu e-posta'nin içerdigi bilgiler (ekleri dahil olmak üzere) gizlidir. Onayimiz olmaksizin üçüncü kisilere açiklanamaz. Bu mesajin gönderilmek istendigi kisi degilseniz, lütfen mesaji sisteminizden derhal siliniz. Finansbank A.S. bu mesajin içerdigi bilgilerin dogrulugu veya eksiksiz oldugu konusunda bir garanti vermemektedir. Bu nedenle bilgilerin ne sekilde olursa olsun içeriginden, iletilmesinden, alinmasindan, saklanmasindan sorumlu degildir. Bu mesajin içerigi yazarina ait olup, Finansbank A.S.'nin görüslerini içermeyebilir.
The information contained in this e-mail (including any attachments) is confidential. It must not be disclosed to any person without our authority. If you are not the intended recipient, please delete it from your system immediately. Finansbank A.S. makes no warranty as to the accuracy or completeness of any information contained in this message and hereby excludes any liability of any kind for the information contained therein or for the information transmission, reception, storage or use of such in any way whatsoever. Any opinions expressed in this message are those of the author and may not necessarily reflect the opinions of Finansbank A.S.