Changeset 312 for pkpgcounter/trunk

Show
Ignore:
Timestamp:
02/07/06 19:46:44 (18 years ago)
Author:
jerome
Message:

Now skips Kyocera's Prescribe commands.

Files:
1 modified

Legend:

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

    r311 r312  
    323323                    raise pdlparser.PDLParserError, "Error on size at %x" % self.pos 
    324324            else :     
    325                 pos = pos - 1 
     325                pos -= 1 
    326326        return 0     
    327327         
     
    347347        return endpos - pos 
    348348         
     349    def skipKyoceraPrescribe(self) :     
     350        """Skips Kyocera Prescribe commands.""" 
     351        minfile = self.minfile 
     352        pos = self.pos - 1 
     353        if minfile[pos:pos+3] == "!R!" : 
     354            while (pos - self.pos) < 1024 :   # This is a realistic upper bound, to avoid infinite loops 
     355                if (minfile[pos] == ";") and (minfile[pos-4:pos] == "EXIT") : 
     356                    return (pos + 1 - self.pos) 
     357                pos += 1     
     358        else : 
     359            return 0 
     360             
    349361    def getJobSize(self) : 
    350362        """Counts pages in a PCLXL (PCL6) document. 
     
    394406         
    395407        self.tags[0x1b] = self.escape # The escape code 
     408         
     409        self.tags[0x21]= self.skipKyoceraPrescribe 
    396410         
    397411        # GhostScript's sources tell us that HP printers