How to take printout of linux file from windows xp using putty?

Friends,

I have installed Putty in my windows xp pc. I am connecting the RHEL
AS 3 server using putty from my windows xp. My printer is connected to
my windows xp.
Now, i want to print text.txt of RHEL AS 3.0 in my windows xp printer
through putty.

For Example:
my pc ip is 117.23.2.55
our RHEL AS 3 is 117.23.2.1
my printer is SAMSUNG - ML-1520

what i have to configure and how can i take a printout of the files
from linux?

Thanks
Sathyguy

Hmm, there are a couple of things I'd do, depending on the requirements given by the teacher of your class.

Probably the easiest would be to just pscp the file to the windows box and print it directly.

Alternately you'd have to share your printer to the network, install samba on the red hat box, configure the printer in samba, possibly configure the printer in red hat, and send the file to the printer via samba.

Oh, and a third possibility would be to just connect the printer to the red hat server and print directly, but that's not in your requirements list.

Carl

First, make sure you have the latest version of Putty as I don't think older ones had this option. If you look through the settings pane in the Terminal section, there is an option to select a remote printer (that would be the printer on your XP box). Just click the drop down and select your local printer. Once that's selected, you should be able to print using the correct ASCII escape sequences. The following is taken from "Unix Power Tools" My comments are in square brackets:

----

43.6 Printing to a Terminal Printer

Does your terminal have an extra port on the back for plugging in a printer [that "extra port" is the printer you selected in your Putty Terminal settings]? You might be able to hook up a serial printer to the port. Then you can make a little shell script named something like myprint and use it this way:

% myprint somefile
% someprogram | myprint

The myprint shell script can be as simple as this:

echo "\\033[5i\\c"
cat $*
echo "\\033[4i\\c"

depending on what version of echo your UNIX has . (46.10) Your terminal may need different escape sequences; these are for a VT100-compatible terminal. (Articles 41.10 and 5.2 can help.) Some terminals may require a newline after the escape sequences; if yours doesn't work, try the echo commands without the /c or -n.

----

I think that should work, but you'll need to do some digging around if those ASCII escape sequences don't work for you.

Deckard,

What i did is....

From the above link i configured putty. Like as you said......in your reply

After that

i tried this command from putty.

$ lpr -P SamsungML1520 test.txt

i get the following error....

lpr: unable to print file: server-error-service-unavailable

what might be the reason?

onemore thing....if i configure cups in the server can i able to print through putty.?