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. |
---|
23 | |
---|
24 | It can currently compute the number of pages in several types of files : |
---|
25 | |
---|
26 | - PostScript (both DSC compliant and binary) |
---|
27 | |
---|
28 | - PDF |
---|
29 | |
---|
30 | - PCL3/4/5 |
---|
31 | |
---|
32 | - PCLXL (aka PCL6) |
---|
33 | |
---|
34 | - ESC/P2 |
---|
35 | |
---|
36 | - DVI |
---|
37 | |
---|
38 | - TIFF |
---|
39 | |
---|
40 | - OpenDocument (ISO/IEC DIS 26300) |
---|
41 | |
---|
42 | - Zenographics ZjStream |
---|
43 | |
---|
44 | In addition to counting pages, pkpgcounter can also compute the |
---|
45 | ink coverage for the following document types : |
---|
46 | |
---|
47 | - PostScript (both DSC compliant and binary) |
---|
48 | |
---|
49 | - PDF |
---|
50 | |
---|
51 | - DVI |
---|
52 | |
---|
53 | - TIFF (some TIFF files don't work) |
---|
54 | |
---|
55 | Other formats will be supported in the future for ink coverage. |
---|
56 | |
---|
57 | By default, when launched pkpgcounter prints on its standard output |
---|
58 | a single integer representing the total number of pages in all the |
---|
59 | files which filenames you've passed on the command line. |
---|
60 | |
---|
61 | With no argument, or with a single dash in non-option arguments, |
---|
62 | pkpgcounter reads datas to parse from its standard input in addition |
---|
63 | to other non-options arguments which are treated as filenames |
---|
64 | representing the files to parse. |
---|
65 | |
---|
66 | See pkpgcounter --help for details. |
---|
67 | |
---|
68 | ============================================================================= |
---|
69 | |
---|
70 | Installation : |
---|
71 | -------------- |
---|
72 | |
---|
73 | 0 - Download pkpgcounter from : |
---|
74 | |
---|
75 | http://www.pykota.com/software/pkpgcounter/download |
---|
76 | |
---|
77 | and extract it : |
---|
78 | |
---|
79 | $ tar -zxf pkpgcounter-x.yy.tar.gz |
---|
80 | |
---|
81 | where x.yy is pkpgcounter' version number. |
---|
82 | |
---|
83 | 1 - Run the installation script : |
---|
84 | |
---|
85 | $ python setup.py install |
---|
86 | |
---|
87 | This will usually install the pkpgcounter into /usr/bin and |
---|
88 | the library into /usr/lib/python2.?/site-packages/pkpgpdls/ |
---|
89 | |
---|
90 | 2 - Use pkpgcounter : |
---|
91 | |
---|
92 | $ pkpgcounter file1.ps file2.pclxl ... <fileN.escp2 |
---|
93 | |
---|
94 | pkpgcounter will display the total size in pages of all the files |
---|
95 | passed on the command line. |
---|
96 | |
---|
97 | $ pkpgcounter --colorspace bw --resolution 150 file1.ps |
---|
98 | |
---|
99 | Will output the percent of black ink needed on each page of |
---|
100 | the file1.ps file rendered at 150 dpi. |
---|
101 | |
---|
102 | 3 - That's all ! |
---|
103 | |
---|
104 | |
---|
105 | IMPORTANT : To compute ink coverage, pkpgcounter relies on third party |
---|
106 | software which must be installed. These third party software are : |
---|
107 | |
---|
108 | - GhostScript. |
---|
109 | |
---|
110 | - The Python Imaging Library (PIL). |
---|
111 | |
---|
112 | - The LaTeX typesetting software, in particular the dvips command |
---|
113 | (this one is only needed for the DVI file format). |
---|
114 | |
---|
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 | |
---|
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 | |
---|
129 | ============================================================================= |
---|
130 | |
---|
131 | The PCL3/4/5 parser included in pkpgcounter is a Python backport of an early |
---|
132 | release of the PCLCount software by Eduardo Gielamo Oliveira and Rodolfo Broco |
---|
133 | Manin. |
---|
134 | |
---|
135 | Although this IS NOT needed for pkpgcounter to work, you can download the |
---|
136 | original PCLCount software from : |
---|
137 | |
---|
138 | http://www.fea.unicamp.br/pclcount/ |
---|
139 | |
---|
140 | Their software is distributed under either the terms of a BSD-like license, |
---|
141 | or the terms of the GNU General Public License of the Free Software Foundation. |
---|
142 | |
---|
143 | Over time both software evolved following different paths, and the accounting |
---|
144 | results they give may differ depending on the printer driver being used. |
---|
145 | We know that pkpgcounter's PCL3/4/5 parser sometimes is not accurate, |
---|
146 | and we are working on improving the situation. We currently don't know how |
---|
147 | PCLCount would behave with the same input files. |
---|
148 | |
---|
149 | pkpgcounter's PCLXL (aka PCL6) parser doesn't originate from PCLCount, but |
---|
150 | was written from scratch. |
---|
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, just like pkpgcounter. 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) |
---|