How to get the number of pages and image dpi

  Imaging Toolkit

If one would like to get the number of pages in the TIFF file, one can use the 2 functions below:

1. GetNumberOfImagesInTiffFile: This function has only one parameter the path and filename of the TIFF file.
2. NumberOfTiffImages: This function uses the opened TIFF file. (You can open the file with OpenTiffFile function). For example

TIFFFILE hChain;
int nImages = -1;
hChain = OpenTiffFile(lpszName,T_READ);
if (hChain)
{
nImages = NumberOfTiffImages(hChain, (WORD)ALLVERSIONS);
CloseTiffFile(hChain);
}

One can check the using of the functions (GetNumberOfImagesInTiffFile, NumberOfTiffImages) in the TIFF C++ Sample. The sample is available in the SDK.

Regards,
Technical Support Team