Changeset 3409 for pkpgcounter/trunk

Show
Ignore:
Timestamp:
09/14/08 17:22:43 (16 years ago)
Author:
jerome
Message:

Added basic support for Brother's XL2HB Page Description Language, thanks to Geovanny Junio.

Location:
pkpgcounter/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • pkpgcounter/trunk/CREDITS

    r3397 r3409  
    4242                   made printer drivers. 
    4343 
     44  - Geovanny Junio : Sent a patch to support Brother's XL2HB Page 
     45                     Description Language. 
     46 
    4447============================================================== 
    4548 
  • pkpgcounter/trunk/pkpgpdls/pclxl.py

    r564 r3409  
    1 # -*- coding: UTF-8 -*- 
     1# -*- coding: utf-8 -*- 
    22# 
    33# pkpgcounter : a generic Page Description Language parser 
     
    8383             
    8484    def isValid(self) :     
    85         """Returns True if data is PCLXL aka PCL6, else False.""" 
     85        """Returns True if data is HP PCLXL aka PCL6, or Brother's' XL2HB, else False.""" 
    8686        if (((self.firstblock[:128].find("\033%-12345X") != -1) and \ 
    8787             (self.firstblock.find(" HP-PCL XL;") != -1) and \ 
     
    8989              (self.firstblock.find("LANGUAGE = PCLXL") != -1)))) \ 
    9090             or ((self.firstblock.startswith(chr(0xcd)+chr(0xca)) and (self.firstblock.find(" HP-PCL XL;") != -1))) : 
     91            return True 
     92        elif (self.firstblock[:128].find("\033%-12345X") != -1) \ 
     93            and (self.firstblock.find("BROTHER XL2HB;") != -1) : 
     94            self.format = "XL2HB" 
    9195            return True 
    9296        else :     
     
    255259        """Skip the 'HP-PCL XL' statement if needed.""" 
    256260        minfile = self.minfile 
    257         if nextpos and (minfile[nextpos:nextpos+11] == " HP-PCL XL;") : 
     261        if nextpos \ 
     262           and ((minfile[nextpos:nextpos+11] == " HP-PCL XL;") \ 
     263             or (minfile[nextpos:nextpos+14] == " BROTHER XLHB;")) : 
    258264            pos = nextpos 
    259265            while minfile[pos] != '\n' : 
     
    378384            if not line : 
    379385                break 
    380             pos = line.find(" HP-PCL XL;")     
     386            pos = line.find(" HP-PCL XL;") 
     387            if pos == -1 : 
     388                pos = line.find(" BROTHER XL2HB;") 
    381389            if pos != -1 : 
    382390                found = True 
  • pkpgcounter/trunk/README

    r3381 r3409  
    5656         
    5757        - Brother HBP 
     58 
     59        - Brother XL2HB 
    5860         
    5961        - Hewlett-Packard Lightweight Imaging Device Interface Language 
     
    6567        - ASCII PNM (Netpbm) 
    6668         
    67 The ten latter ones, as well as some TIFF documents, are currently  
     69The eleven latter ones, as well as some TIFF documents, are currently  
    6870only supported in page counting mode.  
    6971