Counting number of pages in tif image file using java

痞子三分冷 提交于 2019-12-24 01:38:29

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!