#!/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 # 1.10 - 2006-09-27/Bl # Alternatively, use Adobe Reader in place of Xpdf's pdftops # 1.20 - 2007-12-03/Bl # Safe temp file creation (fix gentoo bug # 201042) # # Copyright: Helge Blischke / SRZ Berlin 2004-2006 # 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. # As an alternative the Adobe Reader may be used. # # 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' or 'acroread.conf', # respectively, 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 # or the -start and -end options of acroread, respectively # 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= # For pdftops, may be one of "letter", "legal", # "A4", "A3", or "match"; for acroread, the permetted values # are "letter", "legal", "tabloid", "ledger", "executive", # "a3", "a4", "a5", "b4", "b5", respectively (without the # quotes; the names are treated case independent). # In case of acroread, no paper specification is equivalent # to pdsftops's "match". # 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 or the -size option of acroread. # # pdf-opw= # pdf-upw= # expand to the -opw and -upw options of pdftops, # respectively and permit printing of password # protected PDFs. # # pdf-