问题
How can i count the number of pages in tiff file? i get it as byte array
Thanks
回答1:
You can get the number of pages using the Java Advanced Imaging API. I.e. Using:
ImageDecoder.getNumPages()
An example of how to use it can be found here.
回答2:
You could have a look at iText. iText provides you a class called TiffImage.
TiffImage.getNumberOfPages(new RandomAccessFileOrArray(/* your file, input stream or byte array */));
来源:https://stackoverflow.com/questions/4436445/counting-number-of-pages-in-tif-image-file-using-java