Hello
I have a problem extracting images from pdf files using the code below. All images in RGB format look ok, but images in CMYK format does not look ok. What can I do to fix this problem. Do I need to covert the image after export or can I du it during export?


Best regards
/ Pontus

ListIterator pages = pdfDoc.getDocumentCatalog().getAllPages().listIterator();
      int i = 0;
       while( pages.hasNext() )
       {
           PDPage page = (PDPage)pages.next();
           PDResources resources = page.getResources();
          images = resources.getImages();
if( images != null ) {
               Iterator imageIter = images.keySet().iterator();
               while( imageIter.hasNext() )
               {
                   String key = (String)imageIter.next();
                   // System.out.println("key:" + key);
PDXObjectImage image = (PDXObjectImage)images.get( key );
                  image.write2file( name );
         ....

Reply via email to