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