#!/usr/bin/perl -w # pdftops.pl - wrapper script for xpdf's pdftops utility to act as a CUPS filter # ============================================================================== # 1.00 - 2004-10-05/Bl # Initial implementation # # Copyright: Helge Blischke / SRZ Berlin 2004 # This program is free seoftware and governed by the GNU Public License Version 2. # # Description: # ------------ # This program wraps the pdftops utility from the xpdf 3.00 (and higher) suite # to behave as a CUPS filter as a replacement for the original pdftops filter. # # The main purpose of this approach is to keep the properties of a PDF to be # printed as undesturbed as possible, especially with respect to page size, # scaling, and positioning. # # The pdftops utility reads a configuration file 'pdftops.conf' in the # CUPS_SERVERROOT directory, which must exist but may be empty. The sample # configuration file accompanying this program sets the defaults which # seem plausible to me with respect to high end production printers. # # To give the user highest possible flexibility, this program accepts and # evaluates a set of job attributes special to this filter, which are # described below: # # pdf-pages=, # expands to the -f and -l options of pdftops # to select a page range to process. This is independent # of the page-ranges attribute and may significantly # increase throughput when printing page ranges. # Either of these numbers may be omitted. # # pdf-paper= # pdf-paper=x # may be one of letter, legal , A4, A3, or match; # and are the paper width and height # in printers points (1/72 inch). This expands to # either the -paper or the -paperh and -paperw options # of pdftops # # pdf-opw= # pdf-upw= # expand to the -opw and -upw options of pdftops, # respectively and permit printing of password # protected PDFs. # # pdf-