Changeset 387
- Timestamp:
- 09/05/06 23:44:49 (18 years ago)
- Location:
- pkpgcounter/trunk
- Files:
-
- 14 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/man/pkpgcounter.1
r386 r387 2 2 .TH PKPGCOUNTER "1" "September 2006" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 3 3 .SH NAME 4 pkpgcounter \- manual page for pkpgcounter 1.85 alpha4 pkpgcounter \- manual page for pkpgcounter 1.85 5 5 .SH DESCRIPTION 6 pkpgcounter v1.85 alpha(c) 2003, 2004, 2005, 2006 Jerome Alet6 pkpgcounter v1.85 (c) 2003, 2004, 2005, 2006 Jerome Alet 7 7 .PP 8 8 pkpgcounter is a generic Page Description Language parser. -
pkpgcounter/trunk/NEWS
r383 r387 22 22 pkpgcounter News : 23 23 24 * 1.85 : 25 26 - Added support for Samsung QPDL (aka SPL2) file format in page 27 counting mode, thanks to the work done by Aur�en Croc on 28 reverse engineering the file format. 29 24 30 * 1.85alpha : 25 31 -
pkpgcounter/trunk/pkpgpdls/dvi.py
r373 r387 35 35 totiffcommand = 'cat >%(fname)s && dvips -q -o - %(fname)s | gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r%(dpi)i -sOutputFile="%(fname)s" -' 36 36 def isValid(self) : 37 """Returns 1 if data is DVI, else 0."""37 """Returns True if data is DVI, else False.""" 38 38 try : 39 39 if (ord(self.firstblock[0]) == 0xf7) and (ord(self.lastblock[-1]) == 0xdf) : 40 40 self.logdebug("DEBUG: Input file is in the DVI format.") 41 return 141 return True 42 42 else : 43 return 043 return False 44 44 except IndexError : 45 return 045 return False 46 46 47 47 def getJobSize(self) : -
pkpgcounter/trunk/pkpgpdls/escp2.py
r357 r387 31 31 """A parser for ESC/P2 documents.""" 32 32 def isValid(self) : 33 """Returns 1 if data is ESC/P2, else 0."""33 """Returns True if data is ESC/P2, else False.""" 34 34 if self.firstblock.startswith("\033@") or \ 35 35 self.firstblock.startswith("\033*") or \ … … 37 37 self.firstblock.startswith("\0\0\0\033\1@EJL") : # ESC/P Raster ??? Seen on Stylus Photo 1284 38 38 self.logdebug("DEBUG: Input file is in the ESC/P2 format.") 39 return 139 return True 40 40 else : 41 return 041 return False 42 42 43 43 def getJobSize(self) : -
pkpgcounter/trunk/pkpgpdls/ooo.py
r357 r387 32 32 """A parser for OpenOffice.org documents.""" 33 33 def isValid(self) : 34 """Returns 1 if data is DVI, else 0."""34 """Returns True if data is OpenDocument, else False.""" 35 35 if self.firstblock[:2] == "PK" : 36 36 try : … … 39 39 self.metaxml = self.archive.read("meta.xml") 40 40 except : 41 return 041 return False 42 42 else : 43 self.logdebug("DEBUG: Input file is in the Open Office.orgformat.")44 return 143 self.logdebug("DEBUG: Input file is in the OpenDocument (ISO/IEC DIS 26300) format.") 44 return True 45 45 else : 46 return 046 return False 47 47 48 48 def getJobSize(self) : -
pkpgcounter/trunk/pkpgpdls/pcl345.py
r375 r387 84 84 85 85 def isValid(self) : 86 """Returns 1 if data is PCL, else 0."""86 """Returns True if data is PCL3/4/5, else False.""" 87 87 if self.firstblock.startswith("\033E\033") or \ 88 88 (self.firstblock.startswith("\033*rbC") and (not self.lastblock[-3:] == "\f\033@")) or \ … … 92 92 (self.firstblock.startswith(chr(0xcd)+chr(0xca)) and self.firstblock.find("\033E\033")) : 93 93 self.logdebug("DEBUG: Input file is in the PCL3/4/5 format.") 94 return 194 return True 95 95 else : 96 return 096 return False 97 97 98 98 def setPageDict(self, pages, number, attribute, value) : -
pkpgcounter/trunk/pkpgpdls/pclxl.py
r375 r387 81 81 82 82 def isValid(self) : 83 """Returns 1 if data is PCLXL aka PCL6, else 0."""83 """Returns True if data is PCLXL aka PCL6, else False.""" 84 84 if ((self.firstblock[:128].find("\033%-12345X") != -1) and \ 85 85 (self.firstblock.find(" HP-PCL XL;") != -1) and \ … … 87 87 (self.firstblock.find("LANGUAGE = PCLXL") != -1))) : 88 88 self.logdebug("DEBUG: Input file is in the PCLXL (aka PCL6) format.") 89 return 189 return True 90 90 else : 91 return 091 return False 92 92 93 93 def beginPage(self, nextpos) : -
pkpgcounter/trunk/pkpgpdls/pdf.py
r371 r387 45 45 totiffcommand = 'gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r%(dpi)i -sOutputFile="%(fname)s" -' 46 46 def isValid(self) : 47 """Returns 1 if data is PDF, else 0."""47 """Returns True if data is PDF, else False.""" 48 48 if self.firstblock.startswith("%PDF-") or \ 49 49 self.firstblock.startswith("\033%-12345X%PDF-") or \ … … 51 51 (self.firstblock.find("%PDF-") != -1) : 52 52 self.logdebug("DEBUG: Input file is in the PDF format.") 53 return 153 return True 54 54 else : 55 return 055 return False 56 56 57 57 def getJobSize(self) : -
pkpgcounter/trunk/pkpgpdls/pdlparser.py
r371 r387 78 78 79 79 def isValid(self) : 80 """Returns 1 if data is in the expected format, else 0."""80 """Returns True if data is in the expected format, else False.""" 81 81 raise RuntimeError, "Not implemented !" 82 82 -
pkpgcounter/trunk/pkpgpdls/postscript.py
r384 r387 36 36 totiffcommand = 'gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r%(dpi)i -sOutputFile="%(fname)s" -' 37 37 def isValid(self) : 38 """Returns 1 if data is PostScript, else 0."""38 """Returns True if data is PostScript, else False.""" 39 39 if self.firstblock.startswith("%!") or \ 40 40 self.firstblock.startswith("\004%!") or \ … … 46 46 (self.firstblock.find("%!PS-Adobe") != -1) : 47 47 self.logdebug("DEBUG: Input file is in the PostScript format.") 48 return 148 return True 49 49 else : 50 return 050 return False 51 51 52 52 def throughGhostScript(self) : -
pkpgcounter/trunk/pkpgpdls/qpdl.py
r386 r387 73 73 74 74 def isValid(self) : 75 """Returns 1 if data is PCLXL aka PCL6, else 0."""75 """Returns True if data is QPDL aka SPL2, else False.""" 76 76 if ((self.firstblock[:128].find("\033%-12345X") != -1) and \ 77 77 ((self.firstblock.find("LANGUAGE=QPDL") != -1) or \ 78 78 (self.firstblock.find("LANGUAGE = QPDL") != -1))) : 79 79 self.logdebug("DEBUG: Input file is in the QPDL (aka SPL2) format.") 80 return 180 return True 81 81 else : 82 return 082 return False 83 83 84 84 def beginPage(self, nextpos) : -
pkpgcounter/trunk/pkpgpdls/tiff.py
r372 r387 35 35 totiffcommand = "cat >%(fname)s" 36 36 def isValid(self) : 37 """Returns 1 if data is TIFF, else 0."""37 """Returns True if data is TIFF, else False.""" 38 38 littleendian = (chr(0x49)*2) + chr(0x2a) + chr(0) 39 39 bigendian = (chr(0x4d)*2) + chr(0) + chr(0x2a) 40 40 if self.firstblock[:4] in (littleendian, bigendian) : 41 41 self.logdebug("DEBUG: Input file is in the TIFF format.") 42 return 142 return True 43 43 else : 44 return 044 return False 45 45 46 46 def getJobSize(self) : -
pkpgcounter/trunk/pkpgpdls/version.py
r383 r387 23 23 24 24 25 __version__ = "1.85 alpha"25 __version__ = "1.85" 26 26 27 27 __doc__ = """pkpgcounter : a generic Page Description Languages parser.""" -
pkpgcounter/trunk/pkpgpdls/zjstream.py
r385 r387 34 34 """A parser for ZjStream documents.""" 35 35 def isValid(self) : 36 """Returns 1 if data is ZjStream, else 0."""36 """Returns True if data is ZjStream, else False.""" 37 37 if self.firstblock[:4] == "ZJZJ" : 38 38 self.logdebug("DEBUG: Input file is in the Zenographics ZjStream (little endian) format.") 39 39 self.littleEndian() 40 return 140 return True 41 41 elif self.firstblock[:4] == "JZJZ" : 42 42 self.logdebug("DEBUG: Input file is in the Zenographics ZjStream (big endian) format.") 43 43 self.bigEndian() 44 return 144 return True 45 45 else : 46 return 046 return False 47 47 48 48 def littleEndian(self) :