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