root / pkpgcounter / trunk / bin / pkpgcounter @ 480

Revision 480, 3.4 kB (checked in by jerome, 17 years ago)

v3.20 is out with support for Brother HBP and improved PCLXL
parser wrt the inclusion of Canon ImageRunner? commands.

  • Property svn:executable set to *
  • Property svn:keywords set to Auth Date Id Rev
Line 
1#! /usr/bin/env python
2# -*- coding: ISO-8859-15 -*-
3#
4# pkpgcounter : a generic Page Description Language parser
5#
6# (c) 2003, 2004, 2005, 2006, 2007 Jerome Alet <alet@librelogiciel.com>
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program.  If not, see <http://www.gnu.org/licenses/>.
19#
20# $Id$
21#
22#
23
24import sys
25from pkpgpdls.version import __version__, __author__, __authoremail__, \
26                                __years__, __gplblurb__
27from pkpgpdls import analyzer
28
29__doc__ = """pkpgcounter v%(__version__)s (c) %(__years__)s %(__author__)s
30
31pkpgcounter is a generic Page Description Language parser.
32
33pkpgcounter parses any number of input files and/or its standard input
34and outputs the number of pages needed to print these documents.
35
36pkpgcounter can also compute the percent of ink coverage in different
37colorspaces for several file formats.
38
39pkpgcounter currently recognizes the following document formats :
40
41    * PostScript (both DSC compliant and binary)
42    * PDF   
43    * PCLXL (aka PCL6)
44    * PCL3/4/5 (mostly)
45    * DVI
46    * Plain text
47    * TIFF
48    * ESC/P2
49    * OpenDocument (ISO/IEC DIS 26300)
50    * Zenographics ZjStream
51    * Samsung QPDL (aka SPL2)
52    * Samsung SPL1
53    * ESC/PageS03
54    * Brother HBP
55
56The seven latter ones, as well as some TIFF documents, are currently
57only supported in page counting mode.
58
59command line usage :
60
61  pkpgcounter [options] [files]
62
63options :
64
65  -v | --version        Prints pkpgcounter's version number then exits.
66  -h | --help           Prints this message then exits.
67 
68  -d | --debug          Activate debug mode.
69 
70  -cCOLORSPACE, --colorspace=COLORSPACE
71                        Activate the computation of ink usage, and defines the
72                        colorspace to use. Supported values are 'BW' (Black),
73                        'RGB', 'CMYK', 'CMY', and 'GC' (Grayscale vs Color).
74                        'GC' is useful if you only need to differentiate
75                        grayscale pages from coloured pages but don't care
76                        about ink usage per se.
77                       
78  -rRESOLUTION, --resolution=RESOLUTION
79                        The resolution in DPI to use when checking ink usage.
80                        Lower resolution is faster but less accurate. Default
81                        is 72 dpi.
82 
83examples :                             
84
85  $ pkpgcounter file1.ps file2.escp2 file3.pclxl <file4.pcl345
86 
87  Will launch pkpgcounter and will output the total number of pages
88  needed to print all the documents specified.
89 
90  $ pkpgcounter --colorspace bw --resolution 150 file1.ps
91 
92  Will output the percent of black ink needed on each page of
93  the file1.ps file rendered at 150 dpi.
94 
95%(__gplblurb__)s 
96
97Please e-mail bugs to: %(__authoremail__)s"""
98
99if __name__ == "__main__" : 
100    if (len(sys.argv) >= 2) and (sys.argv[1] in ("-h", "--help")) :
101        print __doc__ % globals()
102    else :   
103        analyzer.main()
Note: See TracBrowser for help on using the browser.