Changeset 480
- Timestamp:
- 10/01/07 23:24:10 (17 years ago)
- Location:
- pkpgcounter/trunk
- Files:
-
- 8 modified
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/bin/pkpgcounter
r476 r480 52 52 * Samsung SPL1 53 53 * ESC/PageS03 54 * Brother HBP 54 55 55 The s ixlatter ones, as well as some TIFF documents, are currently56 The seven latter ones, as well as some TIFF documents, are currently 56 57 only supported in page counting mode. 57 58 -
pkpgcounter/trunk/debian/control
r476 r480 43 43 * ESC/PageS03 44 44 . 45 The six latter formats, as well as some TIFF files, are 45 * Brother HBP 46 . 47 The seven latter formats, as well as some TIFF files, are 46 48 only supported in page counting mode. 47 49 . -
pkpgcounter/trunk/man/pkpgcounter.1
r476 r480 1 1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. 2 .TH PKPGCOUNTER "1" " September 2007" "C@LL - Conseil Internet & Logiciels Libres" "User Commands"2 .TH PKPGCOUNTER "1" "October 2007" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 3 3 .SH NAME 4 pkpgcounter \- manual page for pkpgcounter 3. 104 pkpgcounter \- manual page for pkpgcounter 3.20 5 5 .SH DESCRIPTION 6 pkpgcounter v3. 10 (c) 2003, 2004, 2005, 2006, 2007 Jerome Alet6 pkpgcounter v3.20 (c) 2003, 2004, 2005, 2006, 2007 Jerome Alet 7 7 .PP 8 8 pkpgcounter is a generic Page Description Language parser. … … 29 29 * Samsung SPL1 30 30 * ESC/PageS03 31 * Brother HBP 31 32 .PP 32 The s ixlatter ones, as well as some TIFF documents, are currently33 The seven latter ones, as well as some TIFF documents, are currently 33 34 only supported in page counting mode. 34 35 .PP -
pkpgcounter/trunk/NEWS
r473 r480 21 21 pkpgcounter News : 22 22 23 * 3.20 : 24 25 - Added a minimal parser for Brother HBP documents. 26 27 - Added support for Canon ImageRunner commands to the PCLXL parser, 28 much like it was already done for the PCL3/4/5 parser. 29 23 30 * 3.10 : 24 31 -
pkpgcounter/trunk/pkpgpdls/analyzer.py
r476 r480 28 28 import tempfile 29 29 30 import version, pdlparser, postscript, pdf, pcl345, pclxl, \30 import version, pdlparser, postscript, pdf, pcl345, pclxl, hbp, \ 31 31 escp2, dvi, tiff, ooo, zjstream, qpdl, spl1, escpages03, plain 32 32 import inkcoverage … … 165 165 zjstream, \ 166 166 ooo, \ 167 hbp, \ 167 168 pcl345, \ 168 169 escp2, \ -
pkpgcounter/trunk/pkpgpdls/hbp.py
r463 r480 21 21 # 22 22 23 """This modules implements a page counter for DVIdocuments."""23 """This modules implements a page counter for Brother HBP documents.""" 24 24 25 25 import sys … … 31 31 32 32 class Parser(pdlparser.PDLParser) : 33 """A parser for DVI documents.""" 34 totiffcommands = [ 'cat >%(fname)s && dvips -q -o - %(fname)s | gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r%(dpi)i -sOutputFile="%(fname)s" -' ] 33 """A parser for HBP documents.""" 35 34 def isValid(self) : 36 """Returns True if data is DVI, else False.""" 37 try : 38 if (ord(self.firstblock[0]) == 0xf7) and (ord(self.lastblock[-1]) == 0xdf) : 39 self.logdebug("DEBUG: Input file is in the DVI format.") 40 return True 41 else : 42 return False 43 except IndexError : 35 """Returns True if data is HBP, else False.""" 36 if self.firstblock.find("@PJL ENTER LANGUAGE = HBP\n") != -1 : 37 self.logdebug("DEBUG: Input file is in the HBP format.") 38 return True 39 else : 44 40 return False 45 41 46 42 def getJobSize(self) : 47 """Counts pages in a DVIdocument.43 """Counts pages in a HBP document. 48 44 49 45 Algorithm by Jerome Alet. … … 51 47 The documentation used for this was : 52 48 53 http://www.math.umd.edu/~asnowden/comp-cont/dvi.html 49 http://sf.net/projects/hbp-for-brother/ 50 51 IMPORTANT : this may not work since @F should be sufficient, 52 but the documentation really is unclear and I don't know 53 how to skip raster data blocks for now. 54 54 """ 55 55 infileno = self.infile.fileno() 56 56 minfile = mmap.mmap(infileno, os.fstat(infileno)[6], prot=mmap.PROT_READ, flags=mmap.MAP_SHARED) 57 57 pagecount = 0 58 pos = -1 59 eofchar = chr(0xdf) 60 postchar = chr(0xf8) 58 59 formfeed = "@G" + chr(0) + chr(0) + chr(1) + chr(0xff) + "@F" 60 fflen = len(formfeed) 61 pos = 0 61 62 try : 62 while minfile[pos] == eofchar : 63 pos -= 1 64 idbyte = minfile[pos] 65 if idbyte != minfile[1] : 66 raise IndexError, "Invalid DVI file." 67 pos = unpack(">I", minfile[pos - 4:pos])[0] 68 if minfile[pos] != postchar : 69 raise IndexError, "Invalid DVI file." 70 pagecount = unpack(">H", minfile[pos + 27: pos + 29])[0] 63 while True : 64 if (minfile[pos] == "@") \ 65 and (minfile[pos:pos+fflen] == formfeed) : 66 pagecount += 1 67 pos += fflen 68 else : 69 pos += 1 71 70 except IndexError : # EOF ? 72 71 pass -
pkpgcounter/trunk/pkpgpdls/version.py
r478 r480 22 22 23 23 24 __version__ = "3. 11alpha"24 __version__ = "3.20" 25 25 26 26 __doc__ = """pkpgcounter : a generic Page Description Languages parser.""" -
pkpgcounter/trunk/README
r473 r480 51 51 - ESC/PageS03 52 52 53 The six latter ones, as well as some TIFF documents, are currently 53 - Brother HBP 54 55 The seven latter ones, as well as some TIFF documents, are currently 54 56 only supported in page counting mode. 55 57 -
pkpgcounter/trunk/tests/runtest.sh
r463 r480 19 19 echo -n "Generating testsuite..." 20 20 gunzip <master.ps.gz >master2.ps 21 for device in cups lj250 lj4dithp ljet2p ljet4pjl ljetplus laserjet ljet3 ljet4 lj5gray lj5mono pxlmono pxlcolor pdfwrite pswrite psgray psmono psrgb epson epsonc eps9mid eps9high stcolor st800 escp escpc pcl3 cdeskjet cdj1600 cdj500 cdj550 cdj670 cdj850 cdj880 cdj890 cdj970 cdjcolor cdjmono dj505j djet500 djet500c hpdj1120c hpdj310 hpdj320 hpdj340 hpdj400 hpdj500 hpdj500c hpdj510 hpdj520 hpdj540 hpdj550c hpdj560c hpdj600 hpdj660c hpdj670c hpdj680c hpdj690c hpdj850c hpdj855c hpdj870c hpdj890c hpdjplus hpdjportable tiff12nc tiff24nc tiffcrle tiffg3 tiffg32d tiffg4 tifflzw tiffpack ; do 21 for device in hl1240 \ 22 hl1250 \ 23 hl7x0 \ 24 lj250 \ 25 lj4dithp \ 26 ljet2p \ 27 ljet4pjl \ 28 ljetplus \ 29 laserjet \ 30 ljet3 \ 31 ljet4 \ 32 lj5gray \ 33 lj5mono \ 34 pxlmono \ 35 pxlcolor \ 36 pdfwrite \ 37 pswrite \ 38 psgray \ 39 psmono \ 40 psrgb \ 41 epson \ 42 epsonc \ 43 eps9mid \ 44 eps9high \ 45 stcolor \ 46 st800 \ 47 escp \ 48 pcl3 \ 49 cdeskjet \ 50 cdj1600 \ 51 cdj500 \ 52 cdj550 \ 53 cdj670 \ 54 cdj850 \ 55 cdj880 \ 56 cdj890 \ 57 cdj970 \ 58 cdjcolor \ 59 cdjmono \ 60 dj505j \ 61 djet500 \ 62 djet500c \ 63 hpdj1120c \ 64 hpdj310 \ 65 hpdj320 \ 66 hpdj340 \ 67 hpdj400 \ 68 hpdj500 \ 69 hpdj500c \ 70 hpdj510 \ 71 hpdj520 \ 72 hpdj540 \ 73 hpdj550c \ 74 hpdj560c \ 75 hpdj600 \ 76 hpdj660c \ 77 hpdj670c \ 78 hpdj680c \ 79 hpdj690c \ 80 hpdj850c \ 81 hpdj855c \ 82 hpdj870c \ 83 hpdj890c \ 84 hpdjplus \ 85 hpdjportable \ 86 tiff12nc \ 87 tiff24nc \ 88 tiffcrle \ 89 tiffg3 \ 90 tiffg32d \ 91 tiffg4 \ 92 tifflzw \ 93 tiffpack ; do 22 94 if ! [ -f "testsuite.$device" ] ; then 23 95 gs -dQUIET -dBATCH -dNOPAUSE -sOutputFile="testsuite.$device" -sDEVICE="$device" master2.ps ;