Changeset 3436
- Timestamp:
- 10/06/08 00:22:07 (3 months ago)
- Location:
- pkpgcounter/trunk
- Files:
-
- 38 modified
-
bin/pkpgcounter (modified) (3 diffs)
-
BUGS (modified) (1 diff)
-
clean.sh (modified) (1 diff)
-
CREDITS (modified) (2 diffs)
-
man/genman.sh (modified) (3 diffs)
-
NEWS (modified) (1 diff)
-
pkpgpdls/analyzer.py (modified) (11 diffs)
-
pkpgpdls/bj.py (modified) (4 diffs)
-
pkpgpdls/cfax.py (modified) (5 diffs)
-
pkpgpdls/dvi.py (modified) (5 diffs)
-
pkpgpdls/escp2.py (modified) (5 diffs)
-
pkpgpdls/escpages03.py (modified) (4 diffs)
-
pkpgpdls/hbp.py (modified) (4 diffs)
-
pkpgpdls/__init__.py (modified) (1 diff)
-
pkpgpdls/inkcoverage.py (modified) (9 diffs)
-
pkpgpdls/lidil.py (modified) (6 diffs)
-
pkpgpdls/mscrap.py (modified) (4 diffs)
-
pkpgpdls/ooo.py (modified) (3 diffs)
-
pkpgpdls/pcl345.py (modified) (36 diffs)
-
pkpgpdls/pclxl.py (modified) (37 diffs)
-
pkpgpdls/pdf.py (modified) (7 diffs)
-
pkpgpdls/pdlparser.py (modified) (9 diffs)
-
pkpgpdls/pil.py (modified) (4 diffs)
-
pkpgpdls/pjl.py (modified) (9 diffs)
-
pkpgpdls/plain.py (modified) (4 diffs)
-
pkpgpdls/pnmascii.py (modified) (3 diffs)
-
pkpgpdls/postscript.py (modified) (11 diffs)
-
pkpgpdls/qpdl.py (modified) (18 diffs)
-
pkpgpdls/spl1.py (modified) (10 diffs)
-
pkpgpdls/tiff.py (modified) (5 diffs)
-
pkpgpdls/version.py (modified) (1 diff)
-
pkpgpdls/zjstream.py (modified) (5 diffs)
-
README (modified) (6 diffs)
-
setup.py (modified) (5 diffs)
-
tests/gstests.py (modified) (14 diffs)
-
tests/README (modified) (1 diff)
-
tests/runcolors.py (modified) (8 diffs)
-
tests/runtest.sh (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/bin/pkpgcounter
r564 r3436 1 1 #! /usr/bin/env python 2 # -*- coding: UTF-8 -*-2 # -*- coding: utf-8 -*- 3 3 # 4 4 # pkpgcounter : a generic Page Description Language parser … … 9 9 # the Free Software Foundation, either version 3 of the License, or 10 10 # (at your option) any later version. 11 # 11 # 12 12 # This program is distributed in the hope that it will be useful, 13 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 15 # GNU General Public License for more details. 16 # 16 # 17 17 # You should have received a copy of the GNU General Public License 18 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. … … 71 71 -v | --version Prints pkpgcounter's version number then exits. 72 72 -h | --help Prints this message then exits. 73 74 -d | --debug Activate debug mode. 75 73 74 -d | --debug Activate debug mode. 75 76 76 -cCOLORSPACE, --colorspace=COLORSPACE 77 77 Activate the computation of ink usage, and defines the 78 78 colorspace to use. Supported values are 'BW' (Black), 79 79 'RGB', 'CMYK', 'CMY', and 'GC' (Grayscale vs Color). 80 'GC' is useful if you only need to differentiate 80 'GC' is useful if you only need to differentiate 81 81 grayscale pages from coloured pages but don't care 82 82 about ink usage per se. 83 83 84 84 -rRESOLUTION, --resolution=RESOLUTION 85 85 The resolution in DPI to use when checking ink usage. 86 86 Lower resolution is faster but less accurate. Default 87 87 is 72 dpi. 88 89 examples : 88 89 examples : 90 90 91 91 $ pkpgcounter file1.ps file2.escp2 file3.pclxl <file4.pcl345 92 92 93 93 Will launch pkpgcounter and will output the total number of pages 94 94 needed to print all the documents specified. 95 95 96 96 $ pkpgcounter --colorspace bw --resolution 150 file1.ps 97 97 98 98 Will output the percent of black ink needed on each page of 99 99 the file1.ps file rendered at 150 dpi. 100 101 %(__gplblurb__)s 100 101 %(__gplblurb__)s 102 102 103 103 Please e-mail bugs to: %(__authoremail__)s""" 104 104 105 if __name__ == "__main__" : 105 if __name__ == "__main__" : 106 106 if (len(sys.argv) >= 2) and (sys.argv[1] in ("-h", "--help")) : 107 107 print __doc__ % globals() 108 else : 108 else : 109 109 analyzer.main() 110 110 -
pkpgcounter/trunk/BUGS
r564 r3436 20 20 21 21 pkpgcounter BUGS : 22 22 23 23 - All parsers need more testing, especially those which allow the number 24 24 of copies to be specified as part of the data streams, as well as those -
pkpgcounter/trunk/clean.sh
r564 r3436 8 8 # the Free Software Foundation, either version 3 of the License, or 9 9 # (at your option) any later version. 10 # 10 # 11 11 # This program is distributed in the hope that it will be useful, 12 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 # GNU General Public License for more details. 15 # 15 # 16 16 # You should have received a copy of the GNU General Public License 17 17 # along with this program. If not, see <http://www.gnu.org/licenses/>. -
pkpgcounter/trunk/CREDITS
r3409 r3436 20 20 21 21 The following people helped the pkpgcounter project : 22 23 22 23 24 24 - Eduardo Gielamo Oliveira & Rodolfo Broco Manin : initial PCL parser. 25 25 26 26 - Valcir C. Vargas : helped on PCL3GUI support. 27 28 - Daniel Franklin : pkpgcounter's algorithm for the computation 27 28 - Daniel Franklin : pkpgcounter's algorithm for the computation 29 29 of ink coverage comes from Daniel's PrintBill project. 30 31 - Aur�en Croc : reverse engineered Samsung QPDL and published 30 31 - Aur�en Croc : reverse engineered Samsung QPDL and published 32 32 a language specification. 33 33 34 34 - Franck (?) : sent a path to improve the PostScript parser when 35 35 the PS code generated several copies. 36 37 - Yves Lavoie : reported a bug with Python 2.5 38 36 37 - Yves Lavoie : reported a bug with Python 2.5 38 39 39 - Kumar Appaiah : put pkpgcounter in Debian. 40 40 41 41 - Roger Jochem : reported problems and test files for custom 42 42 made printer drivers. … … 50 50 THINK YOU DESERVE TO BE LISTED, JUST SEND ME AN EMAIL 51 51 ASKING FOR BEING INCLUDED. 52 52 53 53 I APOLOGIZE IN ADVANCE IF I'VE FORGOTTEN TO ADD YOUR NAME. 54 55 ALSO, SOME PEOPLE MAY HAVE REFUSED TO BE LISTED HERE, THIS 54 55 ALSO, SOME PEOPLE MAY HAVE REFUSED TO BE LISTED HERE, THIS 56 56 IS YOUR RIGHT TO DO SO TOO, JUST TELL ME. 57 57 58 58 ============================================================== -
pkpgcounter/trunk/man/genman.sh
r564 r3436 8 8 # the Free Software Foundation, either version 3 of the License, or 9 9 # (at your option) any later version. 10 # 10 # 11 11 # This program is distributed in the hope that it will be useful, 12 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 # GNU General Public License for more details. 15 # 15 # 16 16 # You should have received a copy of the GNU General Public License 17 17 # along with this program. If not, see <http://www.gnu.org/licenses/>. … … 19 19 # $Id$ 20 20 # 21 for prog in pkpgcounter ; do 21 for prog in pkpgcounter ; do 22 22 echo "$prog" ; 23 23 help2man --no-info \ … … 27 27 --source="C@LL - Conseil Internet & Logiciels Libres" \ 28 28 --output="temp$prog.1" \ 29 $prog ; 29 $prog ; 30 30 /bin/sed -e "s/--/\\\-\\\-/g" <"temp$prog.1" >"$prog.1" ; 31 31 /bin/rm -f "temp$prog.1" -
pkpgcounter/trunk/NEWS
r3402 r3436 22 22 23 23 * 3.51 : 24 24 25 25 - Partial rewrite of the PostScript parser, with huge performance increase. 26 26 27 27 - Fixed a problem in the PostScript parser where the number of copies set with 28 e.g. "dvips -c 9 -o output.ps input.dvi" wasn't correctly detected. 28 e.g. "dvips -c 9 -o output.ps input.dvi" wasn't correctly detected. 29 29 30 30 - Increased accuracy in the PDF parser, with some speed expense but 31 31 some big room for future improvements. 32 32 33 33 * 3.50 : 34 34 35 35 - Added support for Canon BJ/BJC documents in page counting mode. 36 36 37 37 - Added support for Structured Fax documents in page counting mode. 38 38 39 39 - Added support for ASCII PNM (Netpbm) documents in page counting mode. 40 40 41 41 - Fixed a problem with the parsing of SPL1 (GDI) documents : all such 42 42 documents should now be correctly parsed. 43 43 44 44 - Improved the PCL3/4/5 parser. 45 45 46 46 * 3.40 : 47 47 48 48 - Fixed a major bug in the detection of OpenDocument (ISO/IEC DIS 26300) 49 49 files. 50 50 51 51 - Added support for page counting in Microsoft Word (c) (tm) (r) (etc...) 52 52 documents. 53 53 54 54 - Added support for ink accounting in Microsoft Word (c) (tm) (r) (etc...) 55 55 and OpenDocument (ISO/IEC DIS 26300) documents. 56 57 - Now automatically detects missing executable dependencies at runtime. 58 56 57 - Now automatically detects missing executable dependencies at runtime. 58 59 59 * 3.30 : 60 60 61 61 - Added support for all file formats supported by the Python Imaging 62 62 Library. 63 64 - Added a minimal parser for Hewlett-Packard LIDIL documents, as 63 64 - Added a minimal parser for Hewlett-Packard LIDIL documents, as 65 65 produced by the hpijs driver. 66 66 67 67 - Improved general reliability. 68 68 69 69 - Improved detection of PCL3/4/5 jobs. 70 71 - Major code cleaning. 72 70 71 - Major code cleaning. 72 73 73 * 3.20 : 74 74 75 75 - Added a minimal parser for Brother HBP documents. 76 76 77 77 - Added support for Canon ImageRunner commands to the PCLXL parser, 78 78 much like it was already done for the PCL3/4/5 parser. 79 79 80 80 * 3.10 : 81 81 82 82 - Added a minimal parser for ESC/PAGES03 style documents. 83 83 84 84 - Fixed another problem in the code handling the output of Canon's 85 85 ImageRunner printer drivers. 86 86 87 87 * 3.00 : 88 88 89 89 - Fixed a problem in the code handling the output of Canon's ImageRunner 90 90 printer drivers. 91 92 - Licensing terms changed to GNU GPL v3.0 or higher. 93 91 92 - Licensing terms changed to GNU GPL v3.0 or higher. 93 94 94 * 2.18 : 95 95 96 96 - Fixed an incompatibility with Python v2.5 97 98 * 2.17 : 99 97 98 * 2.17 : 99 100 100 - Fixed problems in the handling of PJL number of copies (COPIES= and QTY=) 101 101 which caused the number of copies for each page to be squared. 102 103 * 2.16 : 104 102 103 * 2.16 : 104 105 105 - Fixed a problem in the PCL3/4/5 parser to accomodate line based 106 106 report generators which expect the printer to skip to next page 107 107 based on lines per page instead of sending a specific command. 108 108 109 109 * 2.15 : 110 110 111 111 - Fixed a regexp in the PDF parser which caused some files to be 112 112 incorrectly accounted for. 113 113 114 114 - Improved the detection of the number of copies in PostScript documents. 115 115 116 116 * 2.14 : 117 117 118 118 - Fixed a problem with some PS drivers which don't output %%Page: 119 119 comments. 120 121 * 2.13 : 122 120 121 * 2.13 : 122 123 123 - Nowrecognizes the GC colorspace if you only want to differentiate 124 124 grayscale pages from coloured pages. In this colorspace, the 125 125 percents are always "G : 100.0 C : 0.0" or "G : 0.0 C : 100.0" 126 126 respectively for a grayscale page and a coloured page. 127 127 128 128 * 2.12 : 129 129 130 130 - Fixed a problem with the PostScript parser. 131 131 132 132 * 2.11 : 133 133 134 134 - Improved overall robustness in ink accounting mode. 135 135 136 136 * 2.10 : 137 137 138 138 - Added a plain text parser, with support for both page counting and 139 139 ink coverage. 140 140 141 141 - Added a minimal SPL1 parser. 142 142 143 143 - Fixed a problem in the PCLXL parser related to Kyocera printer drivers. 144 144 145 145 * 2.00 : 146 146 147 147 - The PCL3/4/5 parser was rewritten from scratch and is now 148 148 table driven. 149 149 150 150 - Improved the PostScript parser. 151 151 152 152 * 1.85 : 153 153 154 154 - Added support for Samsung QPDL (aka SPL2) file format in page 155 155 counting mode, thanks to the work done by Aur�en Croc on 156 156 reverse engineering the file format. 157 157 158 158 * 1.85alpha : 159 159 160 160 - Added test document and program to generate the test document 161 161 to check the functionning of the ink coverage computation algorithm. 162 162 163 163 * 1.84 : 164 164 165 165 - Computation of ink coverage now works and is documented. 166 166 The supported file formats are : PS, PDF, PCLXL, PCL3/4/5, 167 167 DVI and TIFF. 168 168 169 169 * 1.84alpha : 170 170 171 171 - Added initial support for the computation of ink coverage. 172 172 See python analyzer.py --help for details. The same command 173 173 line options work for pkpgcounter, although it's not 174 174 documented yet. 175 175 176 176 * 1.83 : 177 178 - Fixed a famously known 'brown paper bag' issue with file type autodetection. 179 177 178 - Fixed a famously known 'brown paper bag' issue with file type autodetection. 179 180 180 * 1.82 : 181 182 - Fixed PCL3/4/5 parser to detect recent Xerox drivers' output. 183 181 182 - Fixed PCL3/4/5 parser to detect recent Xerox drivers' output. 183 184 184 * 1.81 : 185 185 186 186 - Improved the gs+Acrobat Reader fix done in 1.78. 187 187 188 188 * 1.80 : 189 189 190 190 - Added support for Zenographics ZjStream input format. 191 191 192 192 * 1.79 : 193 193 194 194 - Fixed a small problem in PostScript parser with dvips output. 195 195 196 196 * 1.78 : 197 197 198 198 - Launches gs less often when printing is done from Acrobat 199 199 Reader. 200 201 * 1.77 : 202 200 201 * 1.77 : 202 203 203 - Fixed some problems with the code introduced in 1.76. 204 204 205 205 - Improved PCLXL parser's speed by almost 10%. 206 206 207 207 * 1.76 : 208 208 209 209 - Improved the PCLXL parser wrt undocumented tags. 210 210 211 211 - Preliminary support for Kyocera Prescribe commands. 212 212 213 213 * 1.75 : 214 214 215 215 - Added preliminary support for Canon ImageRunner's "LIPS" or "UFR" 216 (I don't know which) Page Description Language. 217 216 (I don't know which) Page Description Language. 217 218 218 * 1.74 : 219 219 220 220 - Fixed a problem in the retrieval of named media sizes in PCLXL. 221 221 222 222 - Changed copyright years. 223 223 224 224 * 1.73 : 225 225 226 226 - Fixed duplex detection code in PCL3/4/5 parser. 227 227 228 228 - Fixed PCLXL detection code. 229 229 230 230 - Fixed retrieval of custom media types' names in PCLXL. 231 231 232 232 - Added inactive code to compute ink coverage ala PrintBill. 233 233 234 234 * 1.72 : 235 235 236 236 - Improved heuristic to detect when ghostscript has to be used to do 237 237 the parsing. 238 238 239 239 * 1.71 : 240 240 241 241 - Now uses ghostscript as the parser when the PS stream was created by a 242 242 particular MSWindows driver. 243 243 244 244 - Only complains about Psyco missing at install time, and stays 245 245 quiet when running without Psyco. 246 246 247 247 * 1.70 : 248 248 249 249 - Fixed some PJL escaping issue in the PCLXL and PCL3/4/5 parsers. 250 250 251 251 * 1.69 : 252 253 - Improved PCL3/4/5 parser. 254 252 253 - Improved PCL3/4/5 parser. 254 255 255 - Improved PCLXL parser wrt PJL stuff. 256 256 257 257 * 1.68 : 258 258 259 259 - Improved PostScript parser. 260 260 261 261 * 1.67 : 262 262 263 263 - Improved PostScript parser. 264 265 - Improved PCL3/4/5 parser. 266 267 * 1.66 : 268 264 265 - Improved PCL3/4/5 parser. 266 267 * 1.66 : 268 269 269 - Improved PCLXL parser. 270 271 - Improved PCL3/4/5 parser. 272 270 271 - Improved PCL3/4/5 parser. 272 273 273 * 1.65 : 274 274 275 275 - Improved PostScript parser. 276 277 - Improved PCL3/4/5 parser. 278 276 277 - Improved PCL3/4/5 parser. 278 279 279 * 1.64 : 280 281 - Improved PCL3/4/5 parser. 282 280 281 - Improved PCL3/4/5 parser. 282 283 283 * 1.63 : 284 284 285 285 - Now handles PJL statements to extract number of copies, duplex mode 286 286 and paper size in the PCLXL and PCL3/4/5 parsers. 287 287 288 288 * 1.62 : 289
