How to used PostProcessing's script in cups-pdf

100 Views Asked by At

I shared the cups-pdf printer so that my students could print from their workstations. I started to develop a service (PHP/JS) that allows the teacher to view printed files, group them, download them or directly send to a physical printer. My problem is that the file names are not speaking to find the origin of this one. I made a bash scipt for the PostProcessing of the cups-pdf module, in the log it tells me to launch it correctly, but nothing happens.

I wrote this script:

#!/bin/bash
tmpfile="$1"
winuser="`echo "$3"|sed "s/.*[\\]\([^\\]*\)/\1/"`"
outfile="/var/www/SprinterT/spool/`date "+%Y-%m-%d-%H-%M-%S"`-$winuser.pdf"
mv "$tmpfile" "$outfile"

When I copy the command from the log and put it in the console everything works but when I print the postprocessing command doesn't seem to work. Has anyone encountered this problem before and found a solution?

I wonder if the error could not come from windows user names in domain\user format because in the log, there is no quote; but how to solve this ?

0

There are 0 best solutions below