From 814d06bf590d02f99ec33dd068ca240cc46b068f Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Tue, 19 May 2020 15:59:20 -0400 Subject: add cups-pdf.postprocessing.sh --- cups-pdf.postprocessing.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 cups-pdf.postprocessing.sh diff --git a/cups-pdf.postprocessing.sh b/cups-pdf.postprocessing.sh new file mode 100755 index 0000000..9c6b2dd --- /dev/null +++ b/cups-pdf.postprocessing.sh @@ -0,0 +1,40 @@ +#!/bin/sh +: This script allows a shared network PDF printer to be +: used to send documents to the default printer. +: That way, clients do not need to install the +: printer-specific driver that would be needed if the +: default printer were shared directly. Only the standard +: cups PDF printer driver is needed. + +: To use: +: +: 1. Copy this file to '/etc/cups/cups-pdf.postprocessing.sh' +: +: 2. Add the following line to '/etc/cups/cups-pdf.conf' : \ +PostProcessing /etc/cups/cups-pdf.postprocessing.sh +: +: 3. Run 'systemctl restart cups' +: + +LOGFILE=/tmp/$0.$$.log +LOGFILE= + +if [ "$LOGFILE" ] +then + exec >>"$LOGFILE" 2>&1 +fi + +set -ex + +: progname "$0" args "$*" + +[ "$2" = nobody ] || exit 0 + +default_printer=$(env - lpstat -d) +default_printer=${default_printer##* } + +[ "$default_printer" ] +[ "$PRINTER_INFO" ] +[ "$PRINTER_INFO" != "$default_printer" ] + +env - lp -d "$default_printer" "$1" -- cgit v1.2.3