Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to get number of pages of a postscript file

0 views
Skip to first unread message

Cecil Westerhof

unread,
Nov 11, 2009, 7:31:50 AM11/11/09
to
I want to get the number of pages of a postscript file. At the moment I
do it with the following statement:
PAGES=$(awk '/^%%Pages:/ { print $2; }' <${FILE})

But I saw that sometimes there is also a zero.
For example I have seen:
%%Pages: 1
%%Pages: 1 0
%%Pages: 2 0
%%Pages: 4

Until now the first number is always the number of pages. But why is
there sometimes a 0? And can I be sure that there is always a correct
number, or is there a better way to find the number of pages of a
postscript file?

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

0 new messages