Index: pkpgcounter/trunk/pkpgpdls/zjstream.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/zjstream.py (revision 328)
+++ pkpgcounter/trunk/pkpgpdls/zjstream.py (revision 329)
@@ -32,9 +32,11 @@
     """A parser for ZjStream documents."""
     def isValid(self) :    
-        """Returns 1 if data is PCLXL aka PCL6, else 0."""
+        """Returns 1 if data is ZjStream, else 0."""
         if self.firstblock[:4] == "ZJZJ" :
+            self.logdebug("DEBUG: Input file is in the Zenographics ZjStream (little endian) format.")
             self.littleEndian()
             return 1
         elif self.firstblock[:4] == "JZJZ" :    
+            self.logdebug("DEBUG: Input file is in the Zenographics ZjStream (big endian) format.")
             self.bigEndian()
             return 1
@@ -58,6 +60,45 @@
     def getJobSize(self) :
         """Computes the number of pages in a ZjStream document."""
-        sys.stderr.write("ZjStream is not supported yet, returning 0 pages.\n")
-        return 0
+        infileno = self.infile.fileno()
+        minfile = mmap.mmap(infileno, os.fstat(infileno)[6], prot=mmap.PROT_READ, flags=mmap.MAP_SHARED)
+        pos = 4
+        startpagecount = endpagecount = 0
+        try :
+            try :
+                while 1 :
+                    header = minfile[pos:pos+16]
+                    if len(header) != 16 :
+                        break
+                    totalChunkSize = unpack(self.unpackLong, header[:4])[0]
+                    chunkType = unpack(self.unpackLong, header[4:8])[0]
+                    numberOfItems = unpack(self.unpackLong, header[8:12])[0]
+                    reserved = unpack(self.unpackShort, header[12:14])[0]
+                    signature = unpack(self.unpackShort, header[14:])[0]
+                    pos += totalChunkSize
+                    if chunkType == 0 :
+                        self.logdebug("startDoc")
+                    elif chunkType == 1 :    
+                        self.logdebug("endDoc")
+                    elif chunkType == 2 :    
+                        self.logdebug("startPage")
+                        startpagecount += 1
+                    elif chunkType == 3 :
+                        self.logdebug("endPage")
+                        endpagecount += 1
+                        
+                    #self.logdebug("Chunk size : %s" % totalChunkSize)
+                    #self.logdebug("Chunk type : 0x%08x" % chunkType)
+                    #self.logdebug("# items : %s" % numberOfItems)
+                    #self.logdebug("reserved : 0x%04x" % reserved)
+                    #self.logdebug("signature : 0x%04x" % signature)
+                    #self.logdebug("\n")
+            except IndexError : # EOF ?
+                pass 
+        finally :        
+            minfile.close()
+            
+        if startpagecount != endpagecount :    
+            sys.stderr.write("ERROR : Incorrect ZjStream datas.\n")
+        return max(startpagecount, endpagecount)
         
 def test() :        
Index: pkpgcounter/trunk/pkpgpdls/version.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/version.py (revision 323)
+++ pkpgcounter/trunk/pkpgpdls/version.py (revision 329)
@@ -20,5 +20,5 @@
 #
 
-__version__ = "1.79"
+__version__ = "1.80"
 
 __doc__ = """pkpgcounter : a generic Page Description Languages parser."""
Index: pkpgcounter/trunk/bin/pkpgcounter
===================================================================
--- pkpgcounter/trunk/bin/pkpgcounter (revision 303)
+++ pkpgcounter/trunk/bin/pkpgcounter (revision 329)
@@ -44,6 +44,6 @@
     * TIFF
     * ESC/P2
-    * OpenOffice.org Writer
-    * OpenOffice.org Impress
+    * OpenDocumet (OpenOffice.org)
+    * Zenographics ZjStream
 
 command line usage :
Index: pkpgcounter/trunk/man/pkpgcounter.1
===================================================================
--- pkpgcounter/trunk/man/pkpgcounter.1 (revision 323)
+++ pkpgcounter/trunk/man/pkpgcounter.1 (revision 329)
@@ -1,8 +1,8 @@
-.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.35.
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.36.
 .TH PKPGCOUNTER "1" "February 2006" "C@LL - Conseil Internet & Logiciels Libres" "User Commands"
 .SH NAME
-pkpgcounter \- manual page for pkpgcounter 1.79
+pkpgcounter \- manual page for pkpgcounter 1.80
 .SH DESCRIPTION
-pkpgcounter v1.79 (c) 2003, 2004, 2005, 2006 Jerome Alet
+pkpgcounter v1.80 (c) 2003, 2004, 2005, 2006 Jerome Alet
 .PP
 pkpgcounter is a generic Page Description Language parser.
@@ -20,6 +20,6 @@
 * TIFF
 * ESC/P2
-* OpenOffice.org Writer
-* OpenOffice.org Impress
+* OpenDocumet (OpenOffice.org)
+* Zenographics ZjStream
 .PP
 command line usage :
Index: pkpgcounter/trunk/NEWS
===================================================================
--- pkpgcounter/trunk/NEWS (revision 325)
+++ pkpgcounter/trunk/NEWS (revision 329)
@@ -22,4 +22,8 @@
 pkpgcounter News :
 
+  * 1.80 :
+  
+    - Added support for Zenographics ZjStream input format.
+    
   * 1.79 :
   
Index: pkpgcounter/trunk/README
===================================================================
--- pkpgcounter/trunk/README (revision 303)
+++ pkpgcounter/trunk/README (revision 329)
@@ -38,7 +38,7 @@
         - TIFF
         
-        - OpenOffice.org Writer
+        - OpenDocument (OpenOffice.org)
         
-        - OpenOffice.org Impress
+        - Zenographics ZjStream
         
 When launched, pkpgcounter prints on its standard output a single 
