Index: pkpgcounter/trunk/pkpgpdls/pclxl.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/pclxl.py (revision 3409)
+++ pkpgcounter/trunk/pkpgpdls/pclxl.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -32,10 +32,10 @@
 class Parser(pdlparser.PDLParser) :
     """A parser for PCLXL (aka PCL6) documents."""
-    totiffcommands = [ 'pcl6 -sDEVICE=pdfwrite -r"%(dpi)i" -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -sOutputFile=- "%(infname)s" | gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r"%(dpi)i" -sOutputFile="%(outfname)s" -', 
+    totiffcommands = [ 'pcl6 -sDEVICE=pdfwrite -r"%(dpi)i" -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -sOutputFile=- "%(infname)s" | gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r"%(dpi)i" -sOutputFile="%(outfname)s" -',
                        'pcl6 -sDEVICE=pswrite -r"%(dpi)i" -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -sOutputFile=- "%(infname)s" | gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r"%(dpi)i" -sOutputFile="%(outfname)s" -',
                      ]
     required = [ "pcl6", "gs" ]
     format = "PCLXL (aka PCL6)"
-    mediasizes = { 
+    mediasizes = {
                     0 : "Letter",
                     1 : "Legal",
@@ -61,7 +61,7 @@
                     21 : "JISExec",
                     96 : "Default",
-                 }   
-                 
-    mediasources = {             
+                 }
+
+    mediasources = {
                      0 : "Default",
                      1 : "Auto",
@@ -73,6 +73,6 @@
                      7 : "ThirdCassette",
                    }
-                   
-    orientations = {               
+
+    orientations = {
                      0 : "Portrait",
                      1 : "Landscape",
@@ -81,6 +81,6 @@
                      4 : "Default",
                    }
-            
-    def isValid(self) :    
+
+    def isValid(self) :
         """Returns True if data is HP PCLXL aka PCL6, or Brother's' XL2HB, else False."""
         if (((self.firstblock[:128].find("\033%-12345X") != -1) and \
@@ -94,12 +94,12 @@
             self.format = "XL2HB"
             return True
-        else :    
+        else :
             return False
-            
+
     def beginPage(self, nextpos) :
         """Indicates the beginning of a new page, and extracts media information."""
         # self.logdebug("BeginPage at %x" % nextpos)
         self.pagecount += 1
-        
+
         # Default values
         mediatypelabel = "Plain"
@@ -108,5 +108,5 @@
         orientationlabel = "Portrait"
         duplexmode = None
-        
+
         # Now go upstream to decode media type, size, source, and orientation
         # this saves time because we don't need a complete parser !
@@ -117,5 +117,5 @@
             if val in (0x44, 0x48, 0x41) : # if previous endPage or openDataSource or beginSession (first page)
                 break
-            if val == 0x26 :    
+            if val == 0x26 :
                 mediasource = ord(minfile[pos - 2])
                 mediasourcelabel = self.mediasources.get(mediasource, str(mediasource))
@@ -132,57 +132,57 @@
                         mediasizelabel = minfile[pos+2:pos+2+arraylength].title()
                         pos -= 1
-                    else :    
+                    else :
                         # if we just found an ubyte, then the media
                         # size is known by its index
                         mediasize = ord(minfile[pos+1])
                         mediasizelabel = self.mediasizes.get(mediasize, str(mediasize))
-                    pos -= 1 
+                    pos -= 1
                     # self.logdebug("Media size : %s" % mediasizelabel)
-            elif val == 0x28 :    
+            elif val == 0x28 :
                 orientation = ord(minfile[pos - 2])
                 orientationlabel = self.orientations.get(orientation, str(orientation))
                 pos -= 4
-            elif val == 0x27 :    
+            elif val == 0x27 :
                 savepos = pos
                 pos -= 1
-                startpos = size = None 
+                startpos = size = None
                 while pos > 0 : # safety check : don't go back to far !
                     val = ord(minfile[pos])
-                    pos -= 1    
+                    pos -= 1
                     if val == 0xc8 :
                         length = self.tags[ord(minfile[pos+2])] # will probably always be a byte or uint16
-                        if length == 1 :    
+                        if length == 1 :
                             startpos = pos + 4
                             size = unpack("B", self.minfile[pos+3:startpos])[0]
-                        elif length == 2 :    
+                        elif length == 2 :
                             startpos = pos + 5
                             size = unpack(self.unpackShort, self.minfile[pos+3:startpos])[0]
-                        elif length == 4 :    
+                        elif length == 4 :
                             startpos = pos + 7
                             size = unpack(self.unpackLong, self.minfile[pos+3:startpos])[0]
-                        else :    
+                        else :
                             raise pdlparser.PDLParserError, "Error on size at %s : %s" % (pos+2, length)
                         break
                 mediatypelabel = minfile[startpos:startpos+size]
                 # self.logdebug("Media type : %s" % mediatypelabel)
-            elif val == 0x34 :    
+            elif val == 0x34 :
                 duplexmode = "Simplex"
                 pos -= 2
-            elif val in (0x35, 0x36) :    
+            elif val in (0x35, 0x36) :
                 duplexmode = "Duplex"
                 pos -= 2
-            # else : TODO : CUSTOM MEDIA SIZE AND UNIT ! 
-            else :    
+            # else : TODO : CUSTOM MEDIA SIZE AND UNIT !
+            else :
                 pos -= 1  # ignored
-        self.pages[self.pagecount] = { "copies" : 1, 
-                                       "orientation" : orientationlabel, 
-                                       "mediatype" : mediatypelabel, 
+        self.pages[self.pagecount] = { "copies" : 1,
+                                       "orientation" : orientationlabel,
+                                       "mediatype" : mediatypelabel,
                                        "mediasize" : mediasizelabel,
                                        "mediasource" : mediasourcelabel,
                                        "duplex" : duplexmode,
-                                     } 
+                                     }
         return 0
-        
-    def endPage(self, nextpos) :    
+
+    def endPage(self, nextpos) :
         """Indicates the end of a page."""
         # self.logdebug("EndPage at %x" % nextpos)
@@ -198,14 +198,14 @@
                 # self.logdebug("Number of copies : %i" % nbcopies)
                 self.pages[self.pagecount]["copies"] = nbcopies
-            except KeyError :    
+            except KeyError :
                 self.logdebug("It looks like this PCLXL file is corrupted.")
         return 0
-        
-    def setColorSpace(self, nextpos) :    
+
+    def setColorSpace(self, nextpos) :
         """Changes the color space."""
         if self.minfile[nextpos-4:nextpos-1] == self.RGBColorSpace : # TODO : doesn't seem to handle all cases !
             self.iscolor = True
         return 0
-            
+
     def array_Generic(self, nextpos, size) :
         """Handles all arrays."""
@@ -220,13 +220,13 @@
         except KeyError :
             raise pdlparser.PDLParserError, "Error on array size at %x" % nextpos
-            
-    def array_8(self, nextpos) :    
+
+    def array_8(self, nextpos) :
         """Handles byte arrays."""
         return self.array_Generic(nextpos, 1)
-        
+
     def array_16(self, nextpos) :
         """Handles 16 bits arrays."""
         return self.array_Generic(nextpos, 2)
-        
+
     def array_32(self, nextpos) :
         """Handles 32 bits arrays and Canon ImageRunner tags."""
@@ -243,18 +243,18 @@
                 toskip += length
             # self.logdebug("Canon ImageRunner skip until %x" % (nextpos+toskip))
-            return toskip    
+            return toskip
         else :
             # This is a normal PCLXL array
             return self.array_Generic(nextpos, 4)
-        
+
     def embeddedDataSmall(self, nextpos) :
         """Handle small amounts of data."""
         return 1 + ord(self.minfile[nextpos])
-        
+
     def embeddedData(self, nextpos) :
         """Handle normal amounts of data."""
         return 4 + unpack(self.unpackLong, self.minfile[nextpos:nextpos+4])[0]
-        
-    def skipHPPCLXL(self, nextpos) :    
+
+    def skipHPPCLXL(self, nextpos) :
         """Skip the 'HP-PCL XL' statement if needed."""
         minfile = self.minfile
@@ -265,10 +265,10 @@
             while minfile[pos] != '\n' :
                 pos += 1
-            length = (pos - nextpos + 1)    
-            # self.logdebug("Skip HP PCLXL statement until %x" % (nextpos + length))  
+            length = (pos - nextpos + 1)
+            # self.logdebug("Skip HP PCLXL statement until %x" % (nextpos + length))
             return length
-        else :    
+        else :
             return 0
-        
+
     def littleEndian(self, nextpos) :
         """Toggles to little endianness."""
@@ -278,5 +278,5 @@
         # self.logdebug("LittleEndian at %x" % (nextpos - 1))
         return self.skipHPPCLXL(nextpos)
-        
+
     def bigEndian(self, nextpos) :
         """Toggles to big endianness."""
@@ -286,10 +286,10 @@
         # self.logdebug("BigEndian at %x" % (nextpos - 1))
         return self.skipHPPCLXL(nextpos)
-    
+
     def reservedForFutureUse(self, nextpos) :
         """Outputs something when a reserved byte is encountered."""
         self.logdebug("Byte at %x is out of the PCLXL Protocol Class 2.0 Specification" % nextpos)
-        return 0    
-        
+        return 0
+
     def x46_class3(self, nextpos) :
         """Undocumented tag 0x46 in class 3.0 streams."""
@@ -301,8 +301,8 @@
             try :
                 offset = self.x46_functions[funcid]
-            except KeyError :    
+            except KeyError :
                 self.logdebug("Unexpected subfunction 0x%02x for undocumented tag 0x46 at %x" % (funcid, nextpos))
                 break
-            else :    
+            else :
                 pos -= offset
                 length = self.tags[ord(self.minfile[pos])]
@@ -315,7 +315,7 @@
                         raise pdlparser.PDLParserError, "Error on size '%s' at %x" % (length, pos+1)
             val = ord(minfile[pos])
-        return 0    
-        
-    def escape(self, nextpos) :    
+        return 0
+
+    def escape(self, nextpos) :
         """Handles the ESC code."""
         pos = endpos = nextpos
@@ -331,6 +331,6 @@
                     quotes += 1
                 endpos += 1
-                
-            # Store this in a per page mapping.    
+
+            # Store this in a per page mapping.
             # NB : First time will be at page 0 (i.e. **before** page 1) !
             stuff = self.escapedStuff.setdefault(self.pagecount, [])
@@ -338,5 +338,5 @@
             self.logdebug("Escaped datas : [%s]" % repr(minfile[pos : endpos]))
         return endpos - pos
-        
+
     def skipKyoceraPrescribe(self, nextpos) :
         """Skips Kyocera Prescribe commands."""
@@ -351,32 +351,32 @@
                     self.logdebug("Prescribe commands : [%s]" % repr(minfile[nextpos-1:pos]))
                     break
-                pos += 1    
+                pos += 1
             return (pos - nextpos)
         else :
             return 0
-            
+
     def getJobSize(self) :
         """Counts pages in a PCLXL (PCL6) document.
-        
+
            Algorithm by Jerome Alet.
-           
+
            The documentation used for this was :
-         
+
            HP PCL XL Feature Reference
            Protocol Class 2.0
-           http://www.hpdevelopersolutions.com/downloads/64/358/xl_ref20r22.pdf 
-           
+           http://www.hpdevelopersolutions.com/downloads/64/358/xl_ref20r22.pdf
+
            Protocol Class 2.1 Supplement
            xl_ref21.pdf
-           
+
            Protocol Class 3.0 Supplement
            xl_refsup30r089.pdf
         """
-        
+
         infileno = self.infile.fileno()
         self.minfile = minfile = mmap.mmap(infileno, os.fstat(infileno)[6], prot=mmap.PROT_READ, flags=mmap.MAP_SHARED)
-        
+
         self.iscolor = False
-        
+
         found = False
         while not found :
@@ -392,35 +392,35 @@
                 if endian == 0x29 :
                     self.littleEndian(0)
-                elif endian == 0x28 :    
+                elif endian == 0x28 :
                     self.bigEndian(0)
                 # elif endian == 0x27 : # TODO : This is the ASCII binding code : what does it do exactly ?
-                # 
-                else :    
+                #
+                else :
                     raise pdlparser.PDLParserError, "Unknown endianness marker 0x%02x at start !" % endian
         if not found :
             raise pdlparser.PDLParserError, "This file doesn't seem to be PCLXL (aka PCL6)"
-            
+
         # Initialize Media Sources
         for i in range(8, 256) :
             self.mediasources[i] = "ExternalTray%03i" % (i - 7)
-            
+
         # Initialize table of tags
-        self.tags = [ 0 ] * 256    
-        
+        self.tags = [ 0 ] * 256
+
         self.tags[0x1b] = self.escape # The escape code
-        
+
         self.tags[0x21] = self.skipKyoceraPrescribe # 0x21 is not normally used
-        
+
         # GhostScript's sources tell us that HP printers
         # only accept little endianness, but we can handle both.
         self.tags[0x28] = self.bigEndian    # BigEndian
         self.tags[0x29] = self.littleEndian # LittleEndian
-        
+
         self.tags[0x43] = self.beginPage    # BeginPage
         self.tags[0x44] = self.endPage      # EndPage
         self.tags[0x45] = self.reservedForFutureUse # reserved
-        
-        self.tags[0x46] = self.x46_class3 
-        
+
+        self.tags[0x46] = self.x46_class3
+
         self.tags[0x4a] = self.reservedForFutureUse # reserved
         self.tags[0x4b] = self.reservedForFutureUse # reserved
@@ -428,21 +428,21 @@
         self.tags[0x4d] = self.reservedForFutureUse # reserved
         self.tags[0x4e] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0x56] = self.reservedForFutureUse # TODO : documentation not clear about reserved status
-        
+
         self.tags[0x57] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0x59] = self.reservedForFutureUse # reserved
         self.tags[0x5a] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0x6a] = self.setColorSpace    # to detect color/b&w mode
-        
+
         self.tags[0x87] = self.reservedForFutureUse # reserved
         self.tags[0x88] = self.reservedForFutureUse # reserved
         self.tags[0x89] = self.reservedForFutureUse # reserved
         self.tags[0x8a] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0x8b] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0x8c] = self.reservedForFutureUse # reserved
         self.tags[0x8d] = self.reservedForFutureUse # reserved
@@ -450,13 +450,13 @@
         self.tags[0x8f] = self.reservedForFutureUse # reserved
         self.tags[0x90] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0x9a] = self.reservedForFutureUse # reserved
         self.tags[0x9c] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xa4] = self.reservedForFutureUse # reserved
         self.tags[0xa5] = self.reservedForFutureUse # reserved
         self.tags[0xa6] = self.reservedForFutureUse # reserved
         self.tags[0xa7] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xaa] = self.reservedForFutureUse # reserved
         self.tags[0xab] = self.reservedForFutureUse # reserved
@@ -465,7 +465,7 @@
         self.tags[0xae] = self.reservedForFutureUse # reserved
         self.tags[0xaf] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xb7] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xba] = self.reservedForFutureUse # reserved
         self.tags[0xbb] = self.reservedForFutureUse # reserved
@@ -473,7 +473,7 @@
         self.tags[0xbd] = self.reservedForFutureUse # reserved
         self.tags[0xbe] = self.reservedForFutureUse # reserved
-        
+
         # self.tags[0xbf] = self.passThrough # PassThrough mode should already be taken care of automatically
-        
+
         self.tags[0xc0] = 1 # ubyte
         self.tags[0xc1] = 2 # uint16
@@ -482,8 +482,8 @@
         self.tags[0xc4] = 4 # sint32
         self.tags[0xc5] = 4 # real32
-        
+
         self.tags[0xc6] = self.reservedForFutureUse # reserved
         self.tags[0xc7] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xc8] = self.array_8  # ubyte_array
         self.tags[0xc9] = self.array_16 # uint16_array
@@ -492,8 +492,8 @@
         self.tags[0xcc] = self.array_32 # sint32_array
         self.tags[0xcd] = self.array_32 # real32_array and unfortunately Canon ImageRunner
-        
+
         self.tags[0xce] = self.reservedForFutureUse # reserved
         self.tags[0xcf] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xd0] = 2 # ubyte_xy
         self.tags[0xd1] = 4 # uint16_xy
@@ -512,5 +512,5 @@
         self.tags[0xde] = self.reservedForFutureUse # reserved
         self.tags[0xdf] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xe0] = 4  # ubyte_box
         self.tags[0xe1] = 8  # uint16_box
@@ -529,5 +529,5 @@
         self.tags[0xee] = self.reservedForFutureUse # reserved
         self.tags[0xef] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xf0] = self.reservedForFutureUse # reserved
         self.tags[0xf1] = self.reservedForFutureUse # reserved
@@ -538,24 +538,24 @@
         self.tags[0xf6] = self.reservedForFutureUse # reserved
         self.tags[0xf7] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xf8] = 1 # attr_ubyte
         self.tags[0xf9] = 2 # attr_uint16
-        
+
         self.tags[0xfa] = self.embeddedData      # dataLength
         self.tags[0xfb] = self.embeddedDataSmall # dataLengthByte
-        
+
         self.tags[0xfc] = self.reservedForFutureUse # reserved
         self.tags[0xfd] = self.reservedForFutureUse # reserved
         self.tags[0xfe] = self.reservedForFutureUse # reserved
         self.tags[0xff] = self.reservedForFutureUse # reserved
-            
-        # color spaces    
+
+        # color spaces
         self.BWColorSpace = "".join([chr(0x00), chr(0xf8), chr(0x03)])
         self.GrayColorSpace = "".join([chr(0x01), chr(0xf8), chr(0x03)])
         self.RGBColorSpace = "".join([chr(0x02), chr(0xf8), chr(0x03)])
-        
+
         # set number of copies
-        self.setNumberOfCopies = "".join([chr(0xf8), chr(0x31)]) 
-        
+        self.setNumberOfCopies = "".join([chr(0xf8), chr(0x31)])
+
         # subcodes for undocumented tag 0x46 and the negative
         # offset to grab the value from.
@@ -569,17 +569,17 @@
                                0x98 : 2,
                              }
-                             
+
         # Markers for Canon ImageRunner printers
         self.imagerunnermarker1 = chr(0xcd) + chr(0xca) + chr(0x10) + chr(0x00)
         self.imagerunnermarker2 = chr(0xcd) + chr(0xca) + chr(0x10) + chr(0x02)
-                             
-        self.pages = { 0 : { "copies" : 1, 
-                             "orientation" : "Default", 
-                             "mediatype" : "Plain", 
-                             "mediasize" : "Default", 
-                             "mediasource" : "Default", 
+
+        self.pages = { 0 : { "copies" : 1,
+                             "orientation" : "Default",
+                             "mediatype" : "Plain",
+                             "mediasize" : "Default",
+                             "mediasource" : "Default",
                              "duplex" : None,
-                           } 
-                     }      
+                           }
+                     }
         tags = self.tags
         self.pagecount = 0
@@ -592,27 +592,27 @@
                     try :
                         tag = ord(minfile[pos])
-                    except OverflowError :    
+                    except OverflowError :
                         pos = oldpos + 1
                     pos += 1
                     length = tags[tag]
                     if length :
-                        if callable(length) :    
+                        if callable(length) :
                             length = length(pos)
-                        oldpos = pos    
-                        pos += length    
-            except IndexError : # EOF ?            
+                        oldpos = pos
+                        pos += length
+            except IndexError : # EOF ?
                 pass
         finally :
             self.minfile.close()
-            
+
         # now handle number of copies for each page (may differ).
         if self.iscolor :
             colormode = "Color"
-        else :    
+        else :
             colormode = "BW"
-            
+
         defaultduplexmode = "Simplex"
         defaultpapersize = ""
-        defaultpjlcopies = 1    
+        defaultpjlcopies = 1
         oldpjlcopies = -1
         oldduplexmode = ""
@@ -622,5 +622,5 @@
             # in PCLXL documentation.
             # NB : is number of copies is 0, the page won't be output
-            # but the formula below is still correct : we want 
+            # but the formula below is still correct : we want
             # to decrease the total number of pages in this case.
             page = self.pages.get(pnum, self.pages.get(1, { "copies" : 1, "mediasize" : "Default", "duplex" : None }))
@@ -641,16 +641,16 @@
                     pjlcopies = nbqty
                 else :
-                    if oldpjlcopies == -1 :    
+                    if oldpjlcopies == -1 :
                         pjlcopies = defaultpjlcopies
-                    else :    
-                        pjlcopies = oldpjlcopies    
-                if page["duplex"] :        
+                    else :
+                        pjlcopies = oldpjlcopies
+                if page["duplex"] :
                     duplexmode = page["duplex"]
-                else :    
+                else :
                     defaultdm = pjlparser.default_variables.get("DUPLEX", "")
                     if defaultdm :
                         if defaultdm.upper() == "ON" :
                             defaultduplexmode = "Duplex"
-                        else :    
+                        else :
                             defaultduplexmode = "Simplex"
                     envdm = pjlparser.environment_variables.get("DUPLEX", "")
@@ -658,10 +658,10 @@
                         if envdm.upper() == "ON" :
                             duplexmode = "Duplex"
-                        else :    
+                        else :
                             duplexmode = "Simplex"
-                    else :        
+                    else :
                         if not oldduplexmode :
                             duplexmode = defaultduplexmode
-                        else :    
+                        else :
                             duplexmode = oldduplexmode
                 defaultps = pjlparser.default_variables.get("PAPER", "")
@@ -671,21 +671,21 @@
                 if envps :
                     papersize = envps
-                else :    
+                else :
                     if not oldpapersize :
                         papersize = defaultpapersize
-                    else :    
+                    else :
                         papersize = oldpapersize
-            else :        
+            else :
                 if oldpjlcopies == -1 :
                     pjlcopies = defaultpjlcopies
-                else :    
+                else :
                     pjlcopies = oldpjlcopies
                 if not oldduplexmode :
                     duplexmode = defaultduplexmode
-                else :    
+                else :
                     duplexmode = oldduplexmode
-                if not oldpapersize :    
+                if not oldpapersize :
                     papersize = defaultpapersize
-                else :    
+                else :
                     papersize = oldpapersize
                 duplexmode = oldduplexmode
@@ -693,17 +693,17 @@
             if page["mediasize"] != "Default" :
                 papersize = page["mediasize"]
-            if not duplexmode :    
+            if not duplexmode :
                 duplexmode = oldduplexmode or defaultduplexmode
-            oldpjlcopies = pjlcopies    
+            oldpjlcopies = pjlcopies
             oldduplexmode = duplexmode
             oldpapersize = papersize
             copies = max(pjlcopies, page["copies"]) # Was : pjlcopies * page["copies"]
             self.pagecount += (copies - 1)
-            self.logdebug("%s*%s*%s*%s*%s*%s*%s" % (copies, 
-                                                 page["mediatype"], 
-                                                 papersize, 
-                                                 page["orientation"], 
-                                                 page["mediasource"], 
-                                                 duplexmode, 
+            self.logdebug("%s*%s*%s*%s*%s*%s*%s" % (copies,
+                                                 page["mediatype"],
+                                                 papersize,
+                                                 page["orientation"],
+                                                 page["mediasource"],
+                                                 duplexmode,
                                                  colormode))
         return self.pagecount
