[Scottish] Printing to Windows

willie fleming scottish at mailman.lug.org.uk
Fri Apr 25 16:09:00 2003


Thanks for this Colin, I hope we'll be able to find space for this on 
www.scotlug.org.uk
On Friday 25 Apr 2003 11:44, Colin McKinnon wrote:
> Hi all,
>
> at the meet yesterday, someone (Iain?) was asking about printing to
> Windows attached printers. The easiest way to do it is to use a GUI tool
> too set it all up, the hard way is described below.
>
> I modified the input filter for the printer to that below and wrote a
> wrapper around smbclient (NB there is no good reason in this context why
> the 2 scripts couldn't be merged)
>
> HTH
>
> Colin
>
> ---/var/spool/lpd/default/filter--------------------------
> #!/bin/sh
>
> # next 4 lines are specific to your printer -
> DEVICE=ljet2p
> RESOLUTION=300x300
> PAPERSIZE=a4
> SENDEOF=
>
> # format raw text
> enscript --lineprinter --landscape -Z -fCourier9 -M A4 -p- |
> if [ "$DEVICE" = "PostScript" ]; then
>         cat -
> else
>         gs -q -sDEVICE=$DEVICE \
>                 -r$RESOLUTION \
>                 -sPAPERSIZE=$PAPERSIZE \
>                 -dNOPAUSE \
>                 -dSAFER \
>                 -sOutputFile=- - | /usr/bin/wewsmbprint
> \\\\WindowsBox\\PrinterShare
> fi
>
> if [ "$SENDEOF" != "" ]; then
>         printf "\004"
> fi
> ---------/usr/bin/wewsmbprint---------------------------------
> #!/bin/bash
>
> (
> echo "print -"
> cat
> ) | /usr/bin/smbclient "$1" "" -P >/tmp/lastloprint.log
>
>
>
> _______________________________________________
> Scottish mailing list
> Scottish@mailman.lug.org.uk
> http://mailman.lug.org.uk/mailman/listinfo/scottish

-- 
Best Regards
Willie Fleming
willie@itscotland.demon.co.uk