[reportlab-users] question about postscript

Andy Robinson reportlab-users@reportlab.com
Wed, 5 Feb 2003 23:18:40 -0000


> Hi,
> 
> not really related to ReportLab, but I wondered if counting
> "showpage" occurences in a postscript file gives a correct
> estimation of the number of pages in a ps document.

It would do if they follow the Document Structuring 
Conventions set out by Adobe many years ago.  But in
principle PostScript is a general purpose language
so someone could do the equivalent of

    for i in range(100):
        draw something
        showpage

and your count would be wrong :-)
> 
> may the "showpage" instruction not appear in clear (compressed) ?

Very commonly a producer app defines macros and shortcuts
in the header, so you might find that they abbreviate
it to 'sp' or something.  You have to Read The Source :-)

The good news is that the same producer app (e.g. Quark,
Corel, Illustrator) at least usually does it consistently :-)

Good luck - you'll need it - there are good reasons Adobe
introduced PDF :-)

- Andy