title: Read data from image in PDF
body: <p>I am using <strong>iText java TextExtraction</strong> to read text from PDF file. I use below code and it <strong>works fine for PDF in English</strong> Now I have PDF containing data as image. I want to read data from that image</p>
  
  <pre><code>public class pdfreader {
      public static void main(String[] args) throws IOException, DocumentException, TransformerException {
          String SRC = "";
          String DEST = "";
  
          for (String s : args) {
              SRC = args[0];
              DEST = args[1];
          }
          File file = new File(DEST);
          file.getParentFile().mkdirs();
          new pdfreader().readText(SRC, DEST);
      }
  
      public void readText(String src, String dest) throws IOException, DocumentException, TransformerException {
           try {
                  PdfReader pdfReader = new PdfReader(src);
                  PdfReaderContentParser PdfParser = new PdfReaderContentParser(
                          pdfReader);
                  PrintWriter out = new PrintWriter(new FileOutputStream(
                          dest));
                  TextExtractionStrategy textStrategy;
                  for (int i = 1; i &lt;= pdfReader.getNumberOfPages(); i++) {
                      textStrategy = PdfParser.processContent(i,
                              new SimpleTextExtractionStrategy());
                      out.println(textStrategy.getResultantText());
                  }
                  out.flush();
                  out.close();
                  pdfReader.close();
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      }
  </code></pre>