1 | # $Id$ |
---|
2 | |
---|
3 | pkpgcounter : a generic Page Description Language parser |
---|
4 | |
---|
5 | (c) 2003, 2004, 2005, 2006, 2007, 2008 Jerome Alet <alet@librelogiciel.com> |
---|
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 3 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, see <http://www.gnu.org/licenses/>. |
---|
18 | |
---|
19 | ============================================================================= |
---|
20 | |
---|
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. |
---|
24 | |
---|
25 | pkpgcounter currently recognizes the following document formats : |
---|
26 | |
---|
27 | - PostScript (both DSC compliant and binary) |
---|
28 | |
---|
29 | - PDF |
---|
30 | |
---|
31 | - PCL3/4/5 |
---|
32 | |
---|
33 | - PCLXL (aka PCL6) |
---|
34 | |
---|
35 | - DVI |
---|
36 | |
---|
37 | - OpenDocument (ISO/IEC DIS 26300) |
---|
38 | |
---|
39 | - Microsoft Word (c) (tm) (r) (etc...) |
---|
40 | |
---|
41 | - Plain text |
---|
42 | |
---|
43 | - TIFF |
---|
44 | |
---|
45 | - Several other image formats |
---|
46 | |
---|
47 | - ESC/P2 |
---|
48 | |
---|
49 | - Zenographics ZjStream |
---|
50 | |
---|
51 | - Samsung QPDL (aka SPL2) |
---|
52 | |
---|
53 | - Samsung SPL1 |
---|
54 | |
---|
55 | - ESC/PageS03 |
---|
56 | |
---|
57 | - Brother HBP |
---|
58 | |
---|
59 | - Hewlett-Packard Lightweight Imaging Device Interface Language |
---|
60 | |
---|
61 | - Structured Fax |
---|
62 | |
---|
63 | - Canon BJ/BJC |
---|
64 | |
---|
65 | - ASCII PNM (Netpbm) |
---|
66 | |
---|
67 | The ten latter ones, as well as some TIFF documents, are currently |
---|
68 | only supported in page counting mode. |
---|
69 | |
---|
70 | By default, when launched pkpgcounter prints on its standard output |
---|
71 | a single integer representing the total number of pages in all the |
---|
72 | files which filenames you've passed on the command line. |
---|
73 | |
---|
74 | With no argument, or with a single dash in non-option arguments, |
---|
75 | pkpgcounter reads datas to parse from its standard input in addition |
---|
76 | to other non-options arguments which are treated as filenames |
---|
77 | representing the files to parse. |
---|
78 | |
---|
79 | See pkpgcounter --help for details and examples. |
---|
80 | |
---|
81 | ============================================================================= |
---|
82 | |
---|
83 | Installation : |
---|
84 | -------------- |
---|
85 | |
---|
86 | 0 - Download pkpgcounter from : |
---|
87 | |
---|
88 | http://www.pykota.com/software/pkpgcounter/download |
---|
89 | |
---|
90 | and extract it : |
---|
91 | |
---|
92 | $ tar -zxf pkpgcounter-x.yy.tar.gz |
---|
93 | |
---|
94 | where x.yy is pkpgcounter' version number. |
---|
95 | |
---|
96 | 1 - Run the installation script : |
---|
97 | |
---|
98 | $ python setup.py install |
---|
99 | |
---|
100 | This will usually install the pkpgcounter into /usr/bin and |
---|
101 | the library into /usr/lib/python2.?/site-packages/pkpgpdls/ |
---|
102 | |
---|
103 | 2 - Use pkpgcounter : |
---|
104 | |
---|
105 | $ pkpgcounter file1.ps file2.pclxl ... <fileN.escp2 |
---|
106 | |
---|
107 | pkpgcounter will display the total size in pages of all the files |
---|
108 | passed on the command line. |
---|
109 | |
---|
110 | $ pkpgcounter --colorspace bw --resolution 150 file1.ps |
---|
111 | |
---|
112 | Will output the percent of black ink needed on each page of |
---|
113 | the file1.ps file rendered at 150 dpi. |
---|
114 | |
---|
115 | 3 - That's all ! |
---|
116 | |
---|
117 | DEPENDENCIES : |
---|
118 | |
---|
119 | Most of the time, pkpgcounter only depends on the presence of : |
---|
120 | |
---|
121 | - The Python Imaging Library (python-imaging) |
---|
122 | |
---|
123 | But, depending on the file formats you plan to work with, and on the |
---|
124 | accounting mode you want to use (pages vs ink), you may need to install |
---|
125 | some or all of the additional software listed below. Usually, if one is |
---|
126 | needed then pkpgcounter will complain. So your best bet is probably |
---|
127 | to NOT INSTALL anything until pkpgcounter asks you to do so on its |
---|
128 | standard error stream. Here's the list of software which may be needed |
---|
129 | for some operations with pkpgcounter : |
---|
130 | |
---|
131 | - GhostScript (gs) |
---|
132 | |
---|
133 | - The X Virtual Frame Buffer (xvfb) |
---|
134 | |
---|
135 | - The X authority file utility xauth (xbase-clients) |
---|
136 | |
---|
137 | - The dvips converter from TeX DVI to PostScript (tetex-bin) |
---|
138 | |
---|
139 | - The ImageMagick image manipulation toolkit (imagemagick) |
---|
140 | |
---|
141 | - The AbiWord word processor (abiword) |
---|
142 | |
---|
143 | - The GhostPCL/GhostPDL's pcl6 converter from PCL to PostScript |
---|
144 | |
---|
145 | ============================================================================= |
---|
146 | |
---|
147 | Troubleshooting : |
---|
148 | ----------------- |
---|
149 | |
---|
150 | If pkpgcounter gives incorrect results to you, please make an incorrectly |
---|
151 | parsed data file available to us on some website, and tell us which |
---|
152 | driver was used, how many pages are in the file, and any additional |
---|
153 | information you think is relevant. |
---|
154 | |
---|
155 | If pkpgcounter complain about your system lacking the Python Psyco module, |
---|
156 | please consider installing it to speedup file parsing. However, don't forget |
---|
157 | that Psyco currently only runs on the 32 bits x86 platform, so no need to |
---|
158 | install it if you've got another system type. |
---|
159 | |
---|
160 | ============================================================================= |
---|
161 | |
---|
162 | Before pkpgcounter v1.86, the PCL3/4/5 parser was a Python backport of an early |
---|
163 | release of the PCLCount software by Eduardo Gielamo Oliveira and Rodolfo Broco |
---|
164 | Manin, available from : |
---|
165 | |
---|
166 | http://www.fea.unicamp.br/pclcount/ |
---|
167 | |
---|
168 | Their software is distributed under either the terms of a BSD-like license, |
---|
169 | or the terms of the GNU General Public License of the Free Software Foundation. |
---|
170 | |
---|
171 | Beginning with pkpgcounter v1.86, the PCL3/4/5 parser was rewritten from |
---|
172 | scratch, and is now much more readable, maintainable, and of course accurate. |
---|
173 | |
---|
174 | The old parser was still available until pkpgcounter v2.18 was published, but |
---|
175 | was definitely removed after that, just before pkpgcounter v3.00 was published. |
---|
176 | |
---|
177 | pkpgcounter's PCLXL (aka PCL6) parser doesn't originate from PCLCount, but |
---|
178 | was written from scratch, just like all the other parsers included in |
---|
179 | pkpgcounter. |
---|
180 | |
---|
181 | ============================================================================= |
---|
182 | |
---|
183 | pkpgcounter's ink coverage algorithm for the CMYK colorspace is a |
---|
184 | direct Python port from the PrintBill project by Daniel Franklin. |
---|
185 | PrintBill is distributed under the terms of the GNU General Public |
---|
186 | License of the Free Software Foundation, version 2 or higher. The |
---|
187 | algorithms used for the other colorspaces are a complete rewrite of |
---|
188 | PrintBill's algorithms using both Python and the Python Imaging |
---|
189 | Library's facilities. |
---|
190 | |
---|
191 | ============================================================================= |
---|
192 | |
---|
193 | Please report any problem to the bug tracker at http://trac.pykota.com |
---|