Changeset 329
- Timestamp:
- 02/16/06 15:00:58 (19 years ago)
- Location:
- pkpgcounter/trunk
- Files:
-
- 6 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/bin/pkpgcounter
r303 r329 44 44 * TIFF 45 45 * ESC/P2 46 * Open Office.org Writer47 * OpenOffice.org Impress46 * OpenDocumet (OpenOffice.org) 47 * Zenographics ZjStream 48 48 49 49 command line usage : -
pkpgcounter/trunk/man/pkpgcounter.1
r323 r329 1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.3 5.1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. 2 2 .TH PKPGCOUNTER "1" "February 2006" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 3 3 .SH NAME 4 pkpgcounter \- manual page for pkpgcounter 1. 794 pkpgcounter \- manual page for pkpgcounter 1.80 5 5 .SH DESCRIPTION 6 pkpgcounter v1. 79(c) 2003, 2004, 2005, 2006 Jerome Alet6 pkpgcounter v1.80 (c) 2003, 2004, 2005, 2006 Jerome Alet 7 7 .PP 8 8 pkpgcounter is a generic Page Description Language parser. … … 20 20 * TIFF 21 21 * ESC/P2 22 * Open Office.org Writer23 * OpenOffice.org Impress22 * OpenDocumet (OpenOffice.org) 23 * Zenographics ZjStream 24 24 .PP 25 25 command line usage : -
pkpgcounter/trunk/NEWS
r325 r329 22 22 pkpgcounter News : 23 23 24 * 1.80 : 25 26 - Added support for Zenographics ZjStream input format. 27 24 28 * 1.79 : 25 29 -
pkpgcounter/trunk/pkpgpdls/version.py
r323 r329 20 20 # 21 21 22 __version__ = "1. 79"22 __version__ = "1.80" 23 23 24 24 __doc__ = """pkpgcounter : a generic Page Description Languages parser.""" -
pkpgcounter/trunk/pkpgpdls/zjstream.py
r328 r329 32 32 """A parser for ZjStream documents.""" 33 33 def isValid(self) : 34 """Returns 1 if data is PCLXL aka PCL6, else 0."""34 """Returns 1 if data is ZjStream, else 0.""" 35 35 if self.firstblock[:4] == "ZJZJ" : 36 self.logdebug("DEBUG: Input file is in the Zenographics ZjStream (little endian) format.") 36 37 self.littleEndian() 37 38 return 1 38 39 elif self.firstblock[:4] == "JZJZ" : 40 self.logdebug("DEBUG: Input file is in the Zenographics ZjStream (big endian) format.") 39 41 self.bigEndian() 40 42 return 1 … … 58 60 def getJobSize(self) : 59 61 """Computes the number of pages in a ZjStream document.""" 60 sys.stderr.write("ZjStream is not supported yet, returning 0 pages.\n") 61 return 0 62 infileno = self.infile.fileno() 63 minfile = mmap.mmap(infileno, os.fstat(infileno)[6], prot=mmap.PROT_READ, flags=mmap.MAP_SHARED) 64 pos = 4 65 startpagecount = endpagecount = 0 66 try : 67 try : 68 while 1 : 69 header = minfile[pos:pos+16] 70 if len(header) != 16 : 71 break 72 totalChunkSize = unpack(self.unpackLong, header[:4])[0] 73 chunkType = unpack(self.unpackLong, header[4:8])[0] 74 numberOfItems = unpack(self.unpackLong, header[8:12])[0] 75 reserved = unpack(self.unpackShort, header[12:14])[0] 76 signature = unpack(self.unpackShort, header[14:])[0] 77 pos += totalChunkSize 78 if chunkType == 0 : 79 self.logdebug("startDoc") 80 elif chunkType == 1 : 81 self.logdebug("endDoc") 82 elif chunkType == 2 : 83 self.logdebug("startPage") 84 startpagecount += 1 85 elif chunkType == 3 : 86 self.logdebug("endPage") 87 endpagecount += 1 88 89 #self.logdebug("Chunk size : %s" % totalChunkSize) 90 #self.logdebug("Chunk type : 0x%08x" % chunkType) 91 #self.logdebug("# items : %s" % numberOfItems) 92 #self.logdebug("reserved : 0x%04x" % reserved) 93 #self.logdebug("signature : 0x%04x" % signature) 94 #self.logdebug("\n") 95 except IndexError : # EOF ? 96 pass 97 finally : 98 minfile.close() 99 100 if startpagecount != endpagecount : 101 sys.stderr.write("ERROR : Incorrect ZjStream datas.\n") 102 return max(startpagecount, endpagecount) 62 103 63 104 def test() : -
pkpgcounter/trunk/README
r303 r329 38 38 - TIFF 39 39 40 - Open Office.org Writer40 - OpenDocument (OpenOffice.org) 41 41 42 - OpenOffice.org Impress42 - Zenographics ZjStream 43 43 44 44 When launched, pkpgcounter prints on its standard output a single