Quote:
Originally Posted by michaelk
I have not played with cups-pdf in awhile but you should be able to add a post-processing script in the cups-pdf.conf file.
|
I have already written a script. So should I just paste it with the starting Key, "PostProcessing"? How can I use my script for this?
#PDFVer 1.4
### Key: PostProcessing (config, lptoptions)
## postprocessing script that will be called after the creation of the PDF
## as arguments the filename of the PDF, the username as determined by
## CUPS-PDF and the one as given to CUPS-PDF will be passed
## the script will be called with user privileges
## set this to an empty value to use no postprocessing
### Default: <empty>
PostProcessing
My Script:
#!/bin/bash
# /etc/cups/generate_pdf_filename.sh
# Get current user login
USER=$(whoami)
# Get hostname
HOSTNAME=$(hostname)
# Generate timestamp
TIMESTAMP=$(date +'%Y-%m-%d_%H-%M-%S')
# Construct filename
FILENAME="${HOME}/PDF/stdntrns_${USER}_${HOSTNAME}_${TIMESTAMP}.pdf"