We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Number of Pages in Tiff

Hi,

I want to calculate the Number of Pages and page Size for a given .tiff file.

How to get the information ?

Hi,

Thank you for your inquiry.

Aspose.Imaging for Java API includes com.aspose.imaging.fileformats.tiff.TiffFrame and com.aspose.imaging.imageoptions.TiffOptions class. These classes can be used to get the information. Following lines of code will serve the purpose.


com.aspose.imaging.fileformats.tiff.TiffImage multiImage = (com.aspose.imaging.fileformats.tiff.TiffImage)com.aspose.imaging.Image.load("sample.tif");

System.out.println(multiImage.getFrames().length);
System.out.println(multiImage.getFrames()[0].getFrameOptions().getImageWidth());