This discussion is archived
0 Replies Latest reply: Apr 17, 2013 2:11 AM by 1003569 RSS

Extract Pages from Multipage Tiff

1003569 Newbie
Currently Being Moderated
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;


  • Correct Answers - 10 points
  • Helpful Answers - 5 points