[Samba] pdf-printer

Koenraad Lelong samba.k.lelong at ace-electronics.be
Mon Jun 22 01:44:58 MDT 2015


Hi,

I recently migrated from samba3 to samba4.
On the samba3 server I had a "printer" that converted pcl6 to pdf. I 
tried to make a similar printer in samba4, but it's not working.
Not working means the printed document is nowhere to be found.

This is the section in smb.conf :
[papyrusPDF]
     comment = Papyrus-to-PDF printer
     path = /var/spool/samba
#    guest ok = Yes
     printable = Yes
#    printing = lprng
#    print command = /usr/bin/pcl2pdf %s %u %H "%J"
     print command = /usr/bin/pcl2pdf /var/spool/samba/%s %u %H "%J"
#    lpq command = lpq -P'%p'
     lpq command =
#    lprm command = lprm -P'%p' %j
     lprm command =
#    lppause command = lpc hold '%p' %j
#    lpresume command = lpc release '%p' %j
#    queuepause command = lpc stop '%p'
#    queueresume command = lpc start '%p'

Commented out lines were there in samba3.
pcl2pdf is a script that uses pcl6 to renter pcl6 to pdf. I can use 
pcl2pdf as a regular user.

This is pcl2pdf :

#!/bin/sh

# Simple script to convert a specified pcl file into a PDF document
# and place it in a location that is shared by the Samba server.
#
# Arguments:
#   1st - The name of the spool file
#
# John Bright, 2001, jbright at winfordeng.com

# We will create the pdf into a temporary file based upon the current 
date and time.
# After we are finished, we'll rename it to a file with the same date, 
but ending
# in .pdf.  We do this because if a user tries to open a PDF that is 
still being written,
# they will get a message that it is corrupt, when it is actually just 
not done yet.
DATE=`date +%b%d-%H%M%S`

# Directory in which to place the output
# Be sure this directory exists and is writable by the user that Samba
# is running as (for example, the nobody user)
#OUTDIR=/home/samba/shares/pdf
OUTDIR=/home/temp
echo $1 $2 $3 $4 >> $OUTDIR/log.txt
export PCLFONTSOURCE=/usr/share/urwfonts
/usr/bin/pcl6 -dNOPAUSE -sDEVICE=pdfwrite 
-sOutputFile="$OUTDIR/pap$DATE.tmp" $1
if ! [ -d $OUTDIR/papyrus ]; then mkdir -p $OUTDIR/papyrus
fi
mv "$OUTDIR/pap$DATE.tmp" "$OUTDIR/papyrus/papyrus-$DATE.pdf"
#rm $1

How can I debug this ? In what log-files should errors show up, because 
I can't find any in the existing log-files of samba ?
In pcl2pdf there are some debug-lines, but these do nothing when "used" 
by samba4, which makes me believe the script is not executed.
I did restart samba after I added the section in smb.conf.

Thanks,

Koenraad


More information about the samba mailing list