If the postscript file is correctly formatted, you can grep the instances of %%Page:
grep -c %%Page: document.ps
See here for more info.
An astronomer's guide to possibly useful information
If the postscript file is correctly formatted, you can grep the instances of %%Page:
grep -c %%Page: document.ps
See here for more info.