0 Replies Latest reply on Apr 17, 2013 9:11 AM by 1003569

    Extract Pages from Multipage Tiff

      I'm trying to save all pages from a multipage tiff file into separated files. The following code works fine and saves the separated files, but i can't delete these files when the work is done, because it is used by java. I already close every file, so I don't know what to do. Any idea?
      Thank you!

      FileSeekableStream fss = new FileSeekableStream(“c:\test.tiff”);
      ImageDecoder imde = ImageCodec.createImageDecoder("tiff", fss, null);
      int count = imde.getNumPages();
      TIFFEncodeParam param = new TIFFEncodeParam();
      for (int ii = 0; ii < count; ii++)
           RenderedImage page = imde.decodeAsRenderedImage(ii);
           File f = new File(“c:\Test + "." + (ii+1));
           ParameterBlock pb = new ParameterBlock();
           RenderedOp r = JAI.create("filestore",pb);
           r = null;
           pb = null;
           f = null;
           page = null;
           param = null;
      fss = null;
      imde = null;