Batch - count pages pdf File
Moderator: DosItHelp
Batch - count pages pdf File
Hi guys, it is possible that one batch count the number of pages from a PDF file?
Re: Batch - count pages pdf File
Off course it is.Despite it's in binary format some of the metadata is in plain text:
in batch file you'll need to double the %-es.
the metadata that contains page numbers starts with <</Type/Pages/Count and it can be displayed with type command.
I'll need a little bit more testing to handle different cases e.g. spaces between words.Probably a little bit more sophisticated FINDSTR expression.
But... Probably wont be able to handle all the cases...PDF metada format is too flexible.
Code: Select all
for /f "tokens=4 delims=/^< " %P in ('type Burov.pdf^| find "<</Type/Pages/Count"') do echo %P
in batch file you'll need to double the %-es.
the metadata that contains page numbers starts with <</Type/Pages/Count and it can be displayed with type command.
I'll need a little bit more testing to handle different cases e.g. spaces between words.Probably a little bit more sophisticated FINDSTR expression.
But... Probably wont be able to handle all the cases...PDF metada format is too flexible.