[185] | 1 | # $Id$ |
---|
| 2 | |
---|
| 3 | pkpgcounter : a generic Page Description Language parser |
---|
| 4 | |
---|
[443] | 5 | (c) 2003, 2004, 2005, 2006, 2007 Jerome Alet <alet@librelogiciel.com> |
---|
[463] | 6 | This program is free software: you can redistribute it and/or modify |
---|
[185] | 7 | it under the terms of the GNU General Public License as published by |
---|
[463] | 8 | the Free Software Foundation, either version 3 of the License, or |
---|
[185] | 9 | (at your option) any later version. |
---|
| 10 | |
---|
| 11 | This program is distributed in the hope that it will be useful, |
---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 14 | GNU General Public License for more details. |
---|
| 15 | |
---|
| 16 | You should have received a copy of the GNU General Public License |
---|
[463] | 17 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
[185] | 18 | |
---|
| 19 | ============================================================================= |
---|
| 20 | |
---|
[375] | 21 | pkpgcounter is a generic Page Description Language parser which can either |
---|
| 22 | compute the number of pages in a document, or compute the percent of |
---|
| 23 | ink coverage needed to print each page, in different colorspaces. |
---|
[185] | 24 | |
---|
[375] | 25 | pkpgcounter currently recognizes the following document formats : |
---|
[185] | 26 | |
---|
| 27 | - PostScript (both DSC compliant and binary) |
---|
| 28 | |
---|
| 29 | - PDF |
---|
| 30 | |
---|
| 31 | - PCL3/4/5 |
---|
| 32 | |
---|
| 33 | - PCLXL (aka PCL6) |
---|
| 34 | |
---|
[221] | 35 | - DVI |
---|
| 36 | |
---|
[418] | 37 | - Plain text |
---|
| 38 | |
---|
[221] | 39 | - TIFF |
---|
| 40 | |
---|
[375] | 41 | - ESC/P2 |
---|
| 42 | |
---|
[340] | 43 | - OpenDocument (ISO/IEC DIS 26300) |
---|
[229] | 44 | |
---|
[329] | 45 | - Zenographics ZjStream |
---|
[229] | 46 | |
---|
[386] | 47 | - Samsung QPDL (aka SPL2) |
---|
| 48 | |
---|
[418] | 49 | - Samsung SPL1 |
---|
| 50 | |
---|
| 51 | The five latter ones, as well as some TIFF documents, are currently |
---|
[375] | 52 | only supported in page counting mode. |
---|
[185] | 53 | |
---|
[368] | 54 | By default, when launched pkpgcounter prints on its standard output |
---|
| 55 | a single integer representing the total number of pages in all the |
---|
| 56 | files which filenames you've passed on the command line. |
---|
| 57 | |
---|
[185] | 58 | With no argument, or with a single dash in non-option arguments, |
---|
| 59 | pkpgcounter reads datas to parse from its standard input in addition |
---|
| 60 | to other non-options arguments which are treated as filenames |
---|
| 61 | representing the files to parse. |
---|
| 62 | |
---|
[375] | 63 | See pkpgcounter --help for details and examples. |
---|
[185] | 64 | |
---|
| 65 | ============================================================================= |
---|
| 66 | |
---|
| 67 | Installation : |
---|
| 68 | -------------- |
---|
| 69 | |
---|
| 70 | 0 - Download pkpgcounter from : |
---|
| 71 | |
---|
[336] | 72 | http://www.pykota.com/software/pkpgcounter/download |
---|
[185] | 73 | |
---|
| 74 | and extract it : |
---|
| 75 | |
---|
| 76 | $ tar -zxf pkpgcounter-x.yy.tar.gz |
---|
| 77 | |
---|
| 78 | where x.yy is pkpgcounter' version number. |
---|
| 79 | |
---|
[204] | 80 | 1 - Run the installation script : |
---|
[185] | 81 | |
---|
[204] | 82 | $ python setup.py install |
---|
[185] | 83 | |
---|
[204] | 84 | This will usually install the pkpgcounter into /usr/bin and |
---|
[235] | 85 | the library into /usr/lib/python2.?/site-packages/pkpgpdls/ |
---|
[204] | 86 | |
---|
[185] | 87 | 2 - Use pkpgcounter : |
---|
| 88 | |
---|
| 89 | $ pkpgcounter file1.ps file2.pclxl ... <fileN.escp2 |
---|
| 90 | |
---|
| 91 | pkpgcounter will display the total size in pages of all the files |
---|
| 92 | passed on the command line. |
---|
| 93 | |
---|
[374] | 94 | $ pkpgcounter --colorspace bw --resolution 150 file1.ps |
---|
| 95 | |
---|
| 96 | Will output the percent of black ink needed on each page of |
---|
| 97 | the file1.ps file rendered at 150 dpi. |
---|
| 98 | |
---|
[185] | 99 | 3 - That's all ! |
---|
| 100 | |
---|
[374] | 101 | |
---|
| 102 | IMPORTANT : To compute ink coverage, pkpgcounter relies on third party |
---|
| 103 | software which must be installed. These third party software are : |
---|
| 104 | |
---|
[375] | 105 | - GhostScript (this one is needed for all file formats). |
---|
[374] | 106 | |
---|
[375] | 107 | - The Python Imaging Library, aka PIL (this one is needed for all |
---|
| 108 | file formats). |
---|
[374] | 109 | |
---|
[375] | 110 | - GhostPCL (this one is needed for the PCL3/4/5 and PCLXL formats) |
---|
| 111 | |
---|
[374] | 112 | - The LaTeX typesetting software, in particular the dvips command |
---|
[375] | 113 | (this one is needed for the DVI file format). |
---|
[374] | 114 | |
---|
[185] | 115 | ============================================================================= |
---|
| 116 | |
---|
| 117 | Troubleshooting : |
---|
| 118 | ----------------- |
---|
| 119 | |
---|
| 120 | If pkpgcounter gives incorrect results to you, please make an incorrectly |
---|
| 121 | parsed data file available to us on some website, and tell us which |
---|
| 122 | driver was used. |
---|
| 123 | |
---|
[247] | 124 | If pkpgcounter complain about your system lacking the Python Psyco module, |
---|
| 125 | please consider installing it to speedup file parsing. However, don't forget |
---|
| 126 | that Psyco currently only runs on the 32 bits x86 platform, so no need to |
---|
| 127 | install it if you've got another system type. |
---|
| 128 | |
---|
[185] | 129 | ============================================================================= |
---|
| 130 | |
---|
[406] | 131 | Before pkpgcounter v1.86, the PCL3/4/5 parser was a Python backport of an early |
---|
[286] | 132 | release of the PCLCount software by Eduardo Gielamo Oliveira and Rodolfo Broco |
---|
[406] | 133 | Manin, available from : |
---|
[286] | 134 | |
---|
| 135 | http://www.fea.unicamp.br/pclcount/ |
---|
| 136 | |
---|
| 137 | Their software is distributed under either the terms of a BSD-like license, |
---|
| 138 | or the terms of the GNU General Public License of the Free Software Foundation. |
---|
| 139 | |
---|
[406] | 140 | Beginning with pkpgcounter v1.86, the PCL3/4/5 parser was rewritten from |
---|
| 141 | scratch, and is now much more readable, maintainable, and of course accurate. |
---|
| 142 | |
---|
[463] | 143 | The old parser was still available until pkpgcounter v2.18 was published, but |
---|
| 144 | was definitely removed after that, just before pkpgcounter v3.00 was published. |
---|
[406] | 145 | |
---|
[286] | 146 | pkpgcounter's PCLXL (aka PCL6) parser doesn't originate from PCLCount, but |
---|
[406] | 147 | was written from scratch, just like all the other parsers included in |
---|
| 148 | pkpgcounter. |
---|
[286] | 149 | |
---|
| 150 | ============================================================================= |
---|
| 151 | |
---|
[368] | 152 | pkpgcounter's ink coverage algorithm for the CMYK colorspace is a |
---|
| 153 | direct Python port from the PrintBill project by Daniel Franklin. |
---|
| 154 | PrintBill is distributed under the terms of the GNU General Public |
---|
[463] | 155 | License of the Free Software Foundation, version 2 or higher. The |
---|
[368] | 156 | algorithms used for the other colorspaces are a complete rewrite of |
---|
| 157 | PrintBill's algorithms using both Python and the Python Imaging |
---|
| 158 | Library's facilities. |
---|
| 159 | |
---|
| 160 | ============================================================================= |
---|
| 161 | |
---|
[185] | 162 | Please e-mail bugs to : alet@librelogiciel.com (Jerome Alet) |
---|