You are not logged in.

#1 2013-06-02 19:10:31

acampbell
Member
Registered: 2013-05-15
Posts: 46

Can't print to remote printer

I currently have a printer connected to my desktop as server. I use this with other computers on the local network with lprng on all. On the clients I have a simple printcap pointing to the printer on the desktop.

I'm currently running Arch on a laptop connected to the lan (and am much impressed apart from the printing question).

I tried to compile lprng from AUR but it failed. (Comments indicate problems with this.)

So I installed libcups as suggested by the Arch wiki and configured /etc/cups/client.conf to point to the desktop (arcadia). This should be enough to be able to print, if I've understood right. But nothing prints.

I wasn't clear how to print things with this arrangement since there is no lpr. I I tried  with a2ps on a file but nothing was printed.

Question 1: is it essential to have CUPS on the remote machine? I don't like CUPS, but if I must use it ...

Question 2: how are you supposed to print a plain file with this arrangment, since there is no lpr? I seem to be missing some piece of information here.

Offline

#2 2013-06-02 22:18:34

teckk
Member
Registered: 2013-02-21
Posts: 590

Re: Can't print to remote printer

What language does the printer speak? You don't need cups installed.
If it's a postscript printer, save your document as a .ps file, which most linux editors and office suites will do, then cat it to the printer. You need ghostscript. You'll need to be root.

# cat /path/file.ps > /dev/usb/lp1

If it's a PCl printer then you'll need to convert the .ps to PCL first.

#! /bin/sh

# Takes a postscript filen and convert it to PCL
# Output is suitable for an hp laserjet printer that does NOT have
# the extra postscript option installed
# You MIGHT want to tweak this between "laserjet" or "ljet4" or whatever

# Specify Ghostscript device.
DEVICE=laserjet

# Ouput file name
OUTFILE=output.pcl

GS='gs -q -dSAFER -dNOPAUSE '
GS="$GS -sDEVICE=$DEVICE"

echo "Usage:"
echo " ps2pcl file.ps"
echo " ps2pcl file.ps -o output.pcl file.ps"
echo ""
echo "Will convert PS to PCL and dump to output.ps"
echo "or the specified output file"
echo ""

while getopts "o:h" flag ; do
   case $flag in
	o)
		OUTFILE=$OPTARG
	;;
	
	h|*)
		usage
		exit 1
	;;
   esac
done

shift $(($OPTIND - 1))

INFILE="$1"
if [[ "$INFILE" == "" ]] ; then
	INFILE=-
fi

$GS -sOutputFile=$OUTFILE $INFILE -c quit

If it's a win printer then throw it away. No, you'll need cups and support for the printer. Use your own device nodes. That device=laserjet just worked ok with a Brother printer. If you want to can add to that script and send the .pcl file to the printer after the conversion.

Offline

#3 2013-06-02 22:34:54

teckk
Member
Registered: 2013-02-21
Posts: 590

Re: Can't print to remote printer

Ok, just re read your post. If it's a network printer then netcat might help. Example.

cat file.ps | nc -q 1 192.168.0.3 9100
nc -q 1 192.168.0.3 9100 < file.ps

If it's a printer hooked to a machine then navigate to it, and you'll need permissions to the printer etc.

Offline

#4 2013-06-03 12:02:02

acampbell
Member
Registered: 2013-05-15
Posts: 46

Re: Can't print to remote printer

Thanks for reply.

It's a Brother HL5240 - Postcript not network

I'm thinking of getting a networked version (found a cheap one) - I presume that would be easier to set up, correct? But I think I will have to have CUPS at least on the laptop in order to get lpr?

Offline

Board footer

Powered by FluxBB