Index: /pkpgcounter/trunk/pkpgpdls/lidil.py
===================================================================
--- /pkpgcounter/trunk/pkpgpdls/lidil.py (revision 484)
+++ /pkpgcounter/trunk/pkpgpdls/lidil.py (revision 485)
@@ -36,4 +36,19 @@
 import pdlparser
 
+# Packet types taken from hplip-2.7.10/prnt/ldl.py
+PACKET_TYPE_COMMAND = 0
+PACKET_TYPE_DISABLE_PACING = 1
+PACKET_TYPE_ENABLE_PACING = 2
+PACKET_TYPE_RESUME_NORMAL_OPERATION = 3
+PACKET_TYPE_DISABLE_RESPONSES = 4
+PACKET_TYPE_ENABLE_RESPONSES = 5
+PACKET_TYPE_RESET_LIDIL = 6
+PACKET_TYPE_SYNC = 7
+PACKET_TYPE_SYNC_COMPLETE = 8
+
+# Command codes we are interested in.
+LDL_LOAD_PAGE = 1
+LDL_EJECT_PAGE = 2
+
 class Parser(pdlparser.PDLParser) :
     """A parser for HP LIDIL documents."""
@@ -57,6 +72,32 @@
     def getJobSize(self) :
         """Computes the number of pages in a HP LIDIL document."""
-        ejectpagemarker = "$\x00\x01\x00\x00\x02" # ensure it's a complete packet (ends with '$')
-        return 0
+        pagecount = 0
+        infileno = self.infile.fileno()
+        minfile = mmap.mmap(infileno, os.fstat(infileno)[6], prot=mmap.PROT_READ, flags=mmap.MAP_SHARED)
+        pos = 0
+        try :
+            try :
+                while 1 :
+                    if minfile[pos] != "$" :    # Frame Sync
+                        raise pdlparser.PDLParserError, "This file doesn't seem to be valid Hewlett-Packard LIDIL datas"
+                    try :    
+                        (framesync,     
+                         cmdlength,
+                         dummy,
+                         packettype,
+                         commandnumber,
+                         referencenumber,
+                         datalength) = unpack(">BHBBBHH", minfile[pos:pos+10])
+                    except struct.error :    
+                        raise pdlparser.PDLParserError, "This file doesn't seem to be valid Hewlett-Packard LIDIL datas"
+                    if (packettype == PACKET_TYPE_COMMAND) \
+                        and (commandnumber == LDL_EJECT_PAGE) :
+                        pagecount += 1
+                    pos += (cmdlength + datalength)
+            except IndexError : # EOF ?
+                pass 
+        finally :        
+            minfile.close()
+        return pagecount
 
 if __name__ == "__main__" :    
Index: /pkpgcounter/trunk/pkpgpdls/analyzer.py
===================================================================
--- /pkpgcounter/trunk/pkpgpdls/analyzer.py (revision 480)
+++ /pkpgcounter/trunk/pkpgpdls/analyzer.py (revision 485)
@@ -29,5 +29,5 @@
 
 import version, pdlparser, postscript, pdf, pcl345, pclxl, hbp, \
-       escp2, dvi, tiff, ooo, zjstream, qpdl, spl1, escpages03, plain
+       lidil, escp2, dvi, tiff, ooo, zjstream, qpdl, spl1, escpages03, plain
 import inkcoverage
 
@@ -166,4 +166,5 @@
                            ooo, \
                            hbp, \
+                           lidil, \
                            pcl345, \
                            escp2, \
Index: /pkpgcounter/trunk/pkpgpdls/version.py
===================================================================
--- /pkpgcounter/trunk/pkpgpdls/version.py (revision 480)
+++ /pkpgcounter/trunk/pkpgpdls/version.py (revision 485)
@@ -22,5 +22,5 @@
 
 
-__version__ = "3.20"
+__version__ = "3.30"
 
 __doc__ = """pkpgcounter : a generic Page Description Languages parser."""
Index: /pkpgcounter/trunk/bin/pkpgcounter
===================================================================
--- /pkpgcounter/trunk/bin/pkpgcounter (revision 480)
+++ /pkpgcounter/trunk/bin/pkpgcounter (revision 485)
@@ -53,6 +53,7 @@
     * ESC/PageS03
     * Brother HBP
+    * Hewlett-Packard LIDIL (hpijs)
 
-The seven latter ones, as well as some TIFF documents, are currently 
+The eight latter ones, as well as some TIFF documents, are currently 
 only supported in page counting mode. 
 
Index: /pkpgcounter/trunk/NEWS
===================================================================
--- /pkpgcounter/trunk/NEWS (revision 480)
+++ /pkpgcounter/trunk/NEWS (revision 485)
@@ -21,4 +21,9 @@
 pkpgcounter News :
 
+  * 3.30 :
+  
+    - Added a minimal parser for Hewlett-Packard LIDIL documents, as 
+      produced by the hpijs driver.
+      
   * 3.20 :
    
Index: /pkpgcounter/trunk/README
===================================================================
--- /pkpgcounter/trunk/README (revision 480)
+++ /pkpgcounter/trunk/README (revision 485)
@@ -53,5 +53,7 @@
         - Brother HBP
         
-The seven latter ones, as well as some TIFF documents, are currently 
+        - Hewlett-Packard Lightweight Imaging Device Interface Language
+        
+The eight latter ones, as well as some TIFF documents, are currently 
 only supported in page counting mode. 
 
