#! /usr/bin/env python # -*- coding: ISO-8859-15 -*- # # pkpgcounter : a generic Page Description Language parser # # (c) 2003, 2004, 2005, 2006 Jerome Alet # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # $Id$ # # import sys from pkpgpdls.version import __version__, __author__, __authoremail__, \ __years__, __gplblurb__ from pkpgpdls import analyzer __doc__ = """pkpgcounter v%(__version__)s (c) %(__years__)s %(__author__)s pkpgcounter is a generic Page Description Language parser. pkpgcounter parses any number of input files and/or its standard input and outputs the number of pages needed to print these documents. pkpgcounter currently recognizes the following document formats : * PostScript (both DSC compliant and binary) * PDF * PCLXL (aka PCL6) * PCL3/4/5 (mostly) * DVI * TIFF * ESC/P2 * OpenDocument (ISO/IEC DIS 26300) * Zenographics ZjStream command line usage : pkpgcounter [options] [files] options : -v | --version Prints pkpgcounter's version number then exits. -h | --help Prints this message then exits. -d | --debug Activate debug mode. examples : $ pkpgcounter file1.ps file2.escp2 file3.pclxl = 2) and (sys.argv[1] in ("-h", "--help")) : print __doc__ % globals() elif (len(sys.argv) >= 2) and (sys.argv[1] in ("-v", "--version")) : print __version__ else : analyzer.main()