Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Local Printing

Status
Not open for further replies.

c567591

MIS
Aug 12, 2002
67
US
I am using SCO Openserver 5.0.6

I have configured local printing to work off my local PC.

I can get it to print...sorta.

I only get 1 line, no matter what I print.
I can print to this printer just fine from windows.

What can I do to figure out why I am only getting 1 line?

 
local pc = what os
local printer = ?
protocol to access printer from sco = ?

what are you trying to send to the printer?

There are so many variations on printing that you will have to be a little more specific as to what and how you are trying to do things.
 
localpc=windows2000
local printer=LaserJetIIIp parallel
protocol is the local or transparent printing where the print job is sent to the terminal, bounded by a start local print and an end local print.

I am using TinyTerm as my emulator here on the PC.

Even when I cat the start code, some text, then the end code, I only get 1 line.
 
Sounds like you are lacking the crlf coming out of the server. What printer interface are you using?
I think I used stty in the interface script one time to resolve the issue, but it has been a long time and the memory is getting weak. You might look at man stty to see if it applies.
The line handling needs to be in the spooler output, so you should be able to hook a printer directly and see what the spooler is dumping. Or look at the spooler image and see what it contains.
Normal for output is line teminated by LF, which leads to the other problem (stairstep). Ed Fair
unixstuff@juno.com
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
Is Tinyterm printing directly to the port or thru the windows print spooler? If it is thru the spooler,
try setting the port that the ljIII is on to a file.
Then take a look at what you get in the file from a print job.
 
I found a script on anzio to set stty options print then restore them. This solved the CRLF issue. :)

I am not using a defined printer, since I telnet in, and end up on different ports each time. Is there a way to setup a printer and point it to my current port when I login?

Is there a way to define a printer for whatever the current port may be?
 
I have a similar situation where I have 6 modems used as a dialin pool, and the users always don't hit the same modem every time so I can't lock their local printing to a specific port.

What I have done to resolve this is I identify the port by a "who" command within the printer interface itself, which I pipe through "awk".

Hopefully you are somewhat familiar with printer interface scripts. Here is a sample of my interface script for local printing:

Code:
termport=`who | awk '{if ($1==id) {printf("/dev/%s",$2);exit(0)}}' id=$2`
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#identify the terminal tty port
#Note: The line above must occur before the $2 'user id' parameter is cleared
shift; shift; shift; shift; shift      #clear print job options to prepare for print
penable="\033[5i"                      #string to turn printer output on
pdisable="\033[4i"                     #string to turn printer output off
sttystr="ixon -ixany ixoff"            #string to configure printer flow control
sleep 5                                #wait 5 seconds to let any screen draws finish
exec <$termport >$termport 2>/dev/null #redirect standard out to printer
sttysave=`stty -g`                     #save terminal settings
stty $sttystr                          #turn on printer flow control
echo -n &quot;$penable&quot;                     #turn on printer output
...
#spool print job to standard out#
...
echo -n &quot;$pdisable&quot;                    #turn off printer output
stty $sttysave                         #restore terminal settings
exit 0                                 #exit interface script

This allows local terminal printing to an unfixed port using an ordinary interface file.

There are two disadvantages to this method:

First, the interface can only manage printing to one port at a time, so if user A tries to print while user B is printing to the same interface, user A's job will not start until user B's job is completed. The easiest solution to this is to give each user their own printer interface.

Second, if a user is logged in more than once, the print job is always sent to the smallest port number they are connected to, which may not be the same port as the job originated from. Unfortunately the lp command does not remember the originating ttyport, only the user id, so there really isn't a better solution for this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top