Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 523
  • Last Modified:

Printing via telnet

Is there a way to be able to print via Telnet?

I need to be able to print to a machine-attached printer from which I am telnetting to a remote host, running pine.  I do not have access to the config settings under pine, but I can print to a "terminal-attached printer" by default

Thanks

Vladislav
0
davidzon
Asked:
davidzon
  • 7
  • 3
  • 2
  • +3
1 Solution
 
dhughes111797Commented:
did you already try 'Y' for print? (press O in pine and
you should see it)

It uses VT100 escape sequences to print. Of course, it will
only work if your using some sort of emulation that supports
passing the VT100 escape sequences back for printing..

0
 
davidzonAuthor Commented:
Yes, I've tried the Y to print.  It scrolls the message past my face and telnet does not pick up the print job.

Is there a version of telnet for BSDI (or source code that I can compile) out there that can be used so that when I print through pine (y to print) it will pass it on to the local LPD daemon?

0
 
dhughes111797Commented:
You could take the source from NetBSD or FreeBSD and
compile it to support that. But you'll have to integrate
that in yourself. The telnet client doesn't support that
by default (sending to lpd). It'd probably be easier to
just rcp the file back and print it that way.. (or use
ssh and scp for a more secure way to do it)

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
davidzonAuthor Commented:
Hrmm... What clients are you aware of other than ssh that do this?  I would hate to have to install ssh client / daemon.


0
 
dhughes111797Commented:
The only other way would be to write your own simple
client/server program to do it yourself. (in Perl for
instance - server running on your machine listens to
a connection on a port, receives file, and then prints
it using lpr)

0
 
davidzonAuthor Commented:
Anything server-based is not an option due to a possible security threat.  

I can not be the only one who has been faced with this problem!  Someone must have done this before...

0
 
davidzonAuthor Commented:
Anything server-based is not an option due to a possible security threat.  

I can not be the only one who has been faced with this problem!  Someone must have done this before...

0
 
wjgCommented:
Two methods I can think of: 1) Run script(1) to capture the
output of your whole session and then some filter to extract
the stuff you want to print and 2) Try to solve this with
expect. Expect is available free on most TCL sites and can
probably be used to catch the vt100 printer escape sequence
for automagical redirection of the displayed printjob onto a
local printer (I haven't used expect for quite some time now -
no guarantee that this will work).
0
 
jlmsCommented:
Save the file in pine.
Copy it to your machine (ftp,rcp).
Print it.

If you are working in a UNIX machine (not a terminal) you should use the normal procedure for remote printing.

Please be more specific about how things are: type of machine and OS where you are could be a good start.

0
 
grantkCommented:
Assuming the printer is attached to a system running lpd, just pipe the message to "lpr -Pprintername".

If the printer's on a Unix system, it should have lpd on it already, or you can download it. NT also has a LPD which comes with it.

So, what you'd need to do is:
1) set up lpr on the client
2) set up lpd on the server

For the client, you will need to create or change /etc/princap (as root, or the sysadmin must do it).

myprinter|aliasformyprinter|:\
:lp=:rm=remote.printer.ip.address.com:rp=raw:sd=/var/spool/lpd/myprinter:lf=/var/spool/lpd/myprinter-errs:

Then you can use "lpr -Pmyprinter" to print.


For the server, you'll need to read the docs with the program, but its usually pretty simple.


0
 
tiagoCommented:
Your telnet must support printing to the current device (stdout).
Also, you must print using "attached-to-ansi" in Pine (in your case, the "terminal-attached" printer).

I know only one telnet that can do this, and it comes with the
Exceed package.
0
 
davidzonAuthor Commented:
If you can tell me where to get this package, I will give you a grade of A :>

thanks!

VSD

0
 
tiagoCommented:
0
 
davidzonAuthor Commented:
Excellent answer!

Thanks!

0
 
davidzonAuthor Commented:
Excellent answer!

Thanks!

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 7
  • 3
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now