title: jpedal jpg2000 error
body: <p>I convert pdfs to images using jpedal. This works fine for most of the pdfs but some containing jpeg2000 i continue receiving the following error:</p>
  
  <pre><code> java.lang.RuntimeException: JPeg 2000 Images needs the VM parameter -Dorg.jpedal.jai=true switch turned on
      at org.jpedal.parser.PdfStreamDecoder.decodeStreamIntoObjects(Unknown Source)
      at org.jpedal.parser.PdfStreamDecoder.decodePageContent(Unknown Source)
      at org.jpedal.PDFtoImageConvertor.convert(Unknown Source)
      at org.jpedal.PdfDecoder.getPageAsImage(Unknown Source)
      at org.jpedal.PdfDecoder.getPageAsImage(Unknown Source)
      at com.....
  </code></pre>
  
  <p>I already set the JVM Parameter in the JAVA_OPTS, the run configuration of my tomcat and also in program code using:</p>
  
  <pre><code>System.setProperty("org.jpedal.jai", "true");
  PdfDecoder decode_pdf = new PdfDecoder(true);
  FontMappings.setFontReplacements();
  decode_pdf.openPdfArray(pdf_file);
  </code></pre>
  
  <p>also the 3 JAI libs are on my build path.</p>
  
  <p>So I don't know what else I have to do?</p>
  
  <p>My complete code for the conversion is:</p>
  
  <pre><code>List&lt;BufferedImage&gt; images = new LinkedList&lt;BufferedImage&gt;();           
  System.setProperty("org.jpedal.jai", "true");
  PdfDecoder decode_pdf = new PdfDecoder(true);
  FontMappings.setFontReplacements();
  decode_pdf.openPdfArray(pdf_file);
  decode_pdf.setExtractionMode(0, 1f); //do not save images
  for (int i = 1; i&lt;= decode_pdf.getPageCount(); i++)
  {
    images.add(decode_pdf.getPageAsImage(i));
  }   
  decode_pdf.closePdfFile();
  </code></pre>
  
  <p>Any sugestions?</p>