Mailinglist Archive: opensuse (1606 mails)

< Previous Next >
Re: [opensuse] Native printing via SSH
  • From: "Andrew Joakimsen" <joakimsen@xxxxxxxxx>
  • Date: Sat, 6 Sep 2008 20:46:11 -0400
  • Message-id: <23fd749a0809061746y24dfa239re0d76de78a1d9fc5@xxxxxxxxxxxxxx>
I got it to print one page... but on the back it said Invoice # 40600
printed ok1;1H25;1HCreating file, reading record #1;1H25;4


And when the 2nd page printed it was not formatted (everything was
stuck together with no spacing

And the application hangs with "Printing to LPT1:"

On Sat, Sep 6, 2008 at 7:05 PM, Brian K. White <brian@xxxxxxxxx> wrote:

----- Original Message ----- From: "Andrew Joakimsen" <joakimsen@xxxxxxxxx>
To: "Brian K. White" <brian@xxxxxxxxx>
Cc: <opensuse@xxxxxxxxxxxx>
Sent: Saturday, September 06, 2008 3:49 PM
Subject: Re: [opensuse] Native printing via SSH


That's precisely what I am trying to figure out. Do you know what the
option would be called? The application writes PCL direct to the LPT
port so if I can figure a way to block tty access (I don't think it
will be an issue the application does nothing else while it prints and
in the Windows environment if the printer is not setup correctly the
app just hangs). I am trying to avoid forwarding ports or using a
VPN... because if each user needs to have their own printer I think
this way (with TTY printing) will be easier to mange on the server
side.

Then you may be lucky.
It appears to be possible to tell dosemu to run a command to print.
In fact it appears to be the default way it prints. (last time I used dosemu
was sometime in the late 90's and I seem to remember a completely different
style of config and I seem to remember granting dosemu access to /dev/lp0 ,
not defining a spooler program.
But, it looks simple enough.

Try this,

vi /usr/local/bin/ansiprint

#!/bin/bash
# Print to ansi terminal printer
stty raw </dev/tty
echo -en "\033[5i"
cat "$@"
echo -en "\033[4i"
stty cooked </dev/tty

then
chmod 755 /usr/local/bin/ansiprint


Now put this in /etc/dosemu/dosemu.conf
$_lpt1 = "ansiprint"


The script is used a lot on all my servers so it's heavily tested, but, you
still may have some issue with the stty commands.
You can comment them out and the only result will be that print jobs with
lots of binary raster graphics data will fail.
For several years I didn't have those lines either and almost a thousand end
users did 100% of their buisinesses printing that way, so, even that way is
ok.

The dosemu is untested. However, since the other examples are simply "lpr"
then I know that dosemu must do one of two things, either it gives a temp
file on the command line "lpr filename" or it pipes data into the command.
The script works either of those ways so it should work, as long as you are
right about the dos app's behaviour. I just did a "zypper in dosemu" and
looked at the config file. I haven't actually run anything since I'm on the
road at the moment using a centro as an evdo modem.

If it breaks, you get to keep the pieces :)
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups