Show
Ignore:
Timestamp:
09/07/06 00:13:44 (18 years ago)
Author:
jerome
Message:

Added the detection of number of copies in code generated by some software.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pkpgcounter/trunk/pkpgpdls/postscript.py

    r387 r389  
    139139                    if number > self.pages[pagecount]["copies"] : 
    140140                        self.pages[pagecount]["copies"] = number 
     141            elif line.startswith("{ pop 1 dict dup /NumCopies ") : 
     142                # handle # of copies set by firefox/kprinter/cups (alternate syntax) 
     143                try : 
     144                    number = int(line.strip().split()[6]) 
     145                except : 
     146                    pass 
     147                else : 
     148                    if number > self.pages[pagecount]["copies"] : 
     149                        self.pages[pagecount]["copies"] = number 
    141150            elif line.startswith("/languagelevel where{pop languagelevel}{1}ifelse 2 ge{1 dict dup/NumCopies") : 
    142151                try :