I try to read 2 pdf files with pdfreader. The pdf files contains hebrew characters. The encoding in one file is identity-h and in the other is ANSI. When the encoding is identify-h the hebrew characters are displayed in the console and printed in a txt file correctly. When the encoding is ANSI the hebrew characters are displayed as "?" . The Java method used
public static void loadPdfString(){ FileWriter fileWriter = null; String INPUTFILE = "c:/Sergio/develop/conv_pdf/payslip.pdf"; //Specifying the file location. // String INPUTFILE = "c:/Sergio /develop/conv_pdf/payslip2.PDF"; //Specifying the file location. try { File newTextFile = new File( "C:/Sergio/develop/conv_pdf/payslip_.txt"); fileWriter = new FileWriter(newTextFile); PdfReader reader = new PdfReader(INPUTFILE); int n = reader.getNumberOfPages(); String str=PdfTextExtractor.getTextFromPage(reader, 1); //Extracting the content from a particular page. //Print to console System.out.println(str); System.out.println("------------------------------"); //Print to file fileWriter.write(str); fileWriter.close(); } catch (Exception e) { System.out.println(e); } } Can anyone help me? What is the best method to read hebrew characters? Thank you. Sergio ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may _______________________________________________ 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