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