后端PDF打印机总是显示出理想状态

我想实现一个后端来创build一个在freebsd中使用杯子的PDF打印机。 到目前为止,我成功地使用后端创build打印机,但打印机状态总是空闲,并且根本不接受任何打印作业。

这是我到目前为止所做的,

我已经在Cupsconfiguration文件cupsd.conf使用了<Location /admin><Location /> Allow All权限来进行testing。

之后,我在lib/cups/backend下的backend目录中创build了一个名为pdf的新文件。 在我的pdf文件中,我使用下面的代码,

 #!/bin/sh # ------------------------------------------------------------------- # "/usr/lib/cups/backend/pdf": # ------------------------------------------------------------------- # I have modified the following link with the correct link where my # ps2pdf.cups is PDFBIN=/usr/lib/cups/pdf/ps2pdf.cups FILENAME= # filename of the PDF File PRINTTIME=`date +%Y-%m-%d_%H.%M.%S` # no argument, prints available URIs if [ $# -eq 0 ]; then if [ ! -x "$PDFBIN" ]; then exit 0 fi echo "direct pdf \"Unknown\" \"PDF Creator\"" exit 0 fi # case of wrong number of arguments if [ $# -ne 5 -a $# -ne 6 ]; then echo "Usage: pdf job-id user title copies options [file]" exit 1 fi # get PDF directory from device URI, and check write status PDFDIR=${DEVICE_URI#pdf:} if [ ! -d "$PDFDIR" -o ! -w "$PDFDIR" ]; then echo "ERROR: directory $PDFDIR not writable" exit 1 fi # generate output filename OUTPUTFILENAME= if [ "$3" = "" ]; then OUTPUTFILENAME="$PDFDIR/unknown.pdf" else if [ "$2" != "" ]; then OUTPUTFILENAME="$PDFDIR/$2-$PRINTTIME.pdf" else OUTPUTFILENAME="$PDFDIR/$PRINTTIME.pdf" fi fi # run ghostscript if [ $# -eq 6 ]; then $PDFBIN $6 $OUTPUTFILENAME >& /dev/null else $PDFBIN - $OUTPUTFILENAME >& /dev/null fi # Make the file visible (but read-only except for owner); # This is only needed when the username ($2) is not set, # for instance when printing a test page from the web interface. chmod 644 $OUTPUTFILENAME if [ "$2" != "" ]; then chown $2 $OUTPUTFILENAME chmod 700 $OUTPUTFILENAME fi exit 0 # EOF # ------------------------------------------------------------------- 

来自http://alien.slackbook.org/dokuwiki/doku.php?id=slackware:cups#pdf_printer_scripts

和使用以下命令启动打印机,

 lpadmin -p pdfprinter -v pdf:/var/spool/pdf/ -D "Generate PDF files" -E -P /home/pdfTest/disteller.ppd 

我也设置了myy后端pdf文件的权限为755 ,也尝试过775777localhost:631/printers的打印机状态总是空闲的。

当我点击“打印testing页”从localhost:631/printers

它显示以下错误,

 Print Test Page pdf Error Unable to print test page: No such file or directory 

谁能告诉我我在这里错过了什么?