title: Error while retrieving images from pdf using Itext
body: <p>I have an existing <code>PDF</code> from which I want to retrieve images</p>
  
  <p><strong>NOTE:</strong></p>
  
  <p>In the Documentation, this is the <strong><code>RESULT</code></strong> variable</p>
  
  <pre><code>public static final String RESULT = "results/part4/chapter15/Img%s.%s";
  </code></pre>
  
  <p>I am not getting why this image is needed?I just want to extract the images from my <code>PDF</code> file</p>
  
  <p>So Now when I use         <code>MyImageRenderListener listener = new MyImageRenderListener(RESULT);</code></p>
  
  <p><strong>I am getting the error:</strong></p>
  
  <blockquote>
    <p>results\part4\chapter15\Img16.jpg (The system
    cannot find the path specified)</p>
  </blockquote>
  
  <p>This is the code that I am having.</p>
  
  <pre><code>    package part4.chapter15;
  
      import java.io.IOException;
  
  
      import com.itextpdf.text.DocumentException;
      import com.itextpdf.text.pdf.PdfReader;
      import com.itextpdf.text.pdf.parser.PdfReaderContentParser;
  
      /**
       * Extracts images from a PDF file.
       */
      public class ExtractImages {
  
      /** The new document to which we've added a border rectangle. */
      public static final String RESOURCE = "resources/pdfs/samplefile.pdf";
      public static final String RESULT = "results/part4/chapter15/Img%s.%s";
      /**
       * Parses a PDF and extracts all the images.
       * @param src the source PDF
       * @param dest the resulting PDF
       */
      public void extractImages(String filename)
          throws IOException, DocumentException {
          PdfReader reader = new PdfReader(filename);
          PdfReaderContentParser parser = new PdfReaderContentParser(reader);
          MyImageRenderListener listener = new MyImageRenderListener(RESULT);
          for (int i = 1; i &lt;= reader.getNumberOfPages(); i++) {
              parser.processContent(i, listener);
          }
          reader.close();
      }
  
      /**
       * Main method.
       * @param    args    no arguments needed
       * @throws DocumentException 
       * @throws IOException
       */
      public static void main(String[] args) throws IOException, DocumentException {
          new ExtractImages().extractImages(RESOURCE);
      }
  }
  </code></pre>