Hello,
I have multipage tiff and I wanted to get number of pages in tiff.
Is there any way to get number of pages in tiff page?.If so what is the command for the same ?
How to get number of pages in Tiff file?
Moderators: XnTriq, helmut, xnview
-
- XnThusiast
- Posts: 3894
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: How to get Number of pages in Tiff Page ?
You want to extract the pages of a multi-page TIFF file to separate TIFF files, or possibly just read the number of pages?punith8626 wrote:I have multipage tiff and I wanted to get number of pages in tiff.
Is there any way to get number of pages in tiff page?.If so what is the command for the same ?
The command to extract the pages of a multi-page file is:
Code: Select all
-xall
-
- Posts: 48
- Joined: Thu Feb 02, 2017 11:22 am
Re: How to get Number of pages in Tiff Page ?
I want to just read the number of pages in tiff.
Like in image magic we use command identify to read the number of pages in tiff
Like in image magic we use command identify to read the number of pages in tiff
-
- XnThusiast
- Posts: 3894
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: How to get Number of pages in Tiff Page ?
This should be the NConvert equivalent, if you could check if it shows the number of pages:punith8626 wrote:I want to just read the number of pages in tiff.
Like in image magic we use command identify to read the number of pages in tiff
Code: Select all
-info : Display informations only
-
- Posts: 48
- Joined: Thu Feb 02, 2017 11:22 am
Re: How to get Number of pages in Tiff Page ?
-Info will give all information about the file. But I need to have only number of pages.
-
- XnThusiast
- Posts: 3894
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: How to get Number of pages in Tiff Page ?
There is no specific option for that as far as I know...punith8626 wrote:-Info will give all information about the file. But I need to have only number of pages.

ImageMagick has many more options, but NConvert also has some advantages including faster processing, I believe, and the ability to process input and output files in directories...

-
- Posts: 2
- Joined: Wed Mar 15, 2017 7:36 am
Re: How to get Number of pages in Tiff Page ?
Type in command line. Replace 1.tif with your file name.
With leading space though.
Or create command file pages.cmd
No leading space!
pages.cmd
Result:
With leading space though.
Code: Select all
S:\>for /F "usebackq tokens=2 delims=:" %i in (`nconvert -info 1.tif ^| find "Page(s)"`) do @echo %i
3
S:\>
No leading space!
pages.cmd
Code: Select all
@echo off
set PAGES=
for /F "usebackq tokens=2 delims=:" %%i in (`nconvert -info %1 ^| find "Page(s)"`) do set "PAGES=%%i"
set "PAGES=%PAGES:~1%"
echo %PAGES%
set PAGES=
Code: Select all
S:\>pages 2.tif
6
S:\>
-
- XnThusiast
- Posts: 3894
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: How to get number of pages in Tiff file?
Thank you for posting your solution 0617!
Sadly the very cryptic notation required rather limits the use of cmd.exe by casual users to provide solutions to problems...

Sadly the very cryptic notation required rather limits the use of cmd.exe by casual users to provide solutions to problems...