[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference kernel::unix_printing

Title:Printing from UNIX
Moderator:KERNEL::COFFEYJ
Created:Thu Dec 17 1992
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:956
Total number of notes:2876

942.0. "LG12+ LOSES CURRENT EMULATION FROM DUNIX" by IB001::ANAMARIA (Ana Garc�a, MCS (Madrid)) Tue Apr 29 1997 17:44

    	Hi.
    
    	My customer is using a LG12+ to print some Informix reports from
    Digital UNIX v4.0B. He has to use the Lineprinter+ emulation to define
    the page inches. After loading the printer configuration with the
    Lineprinter+ emulation, the problem arises when, after printing the first 
    job, the printer resets to the LG emulation (that is the default one),
    affecting the rest of jobs.
    
    	I have found, through COMET, this same problem reported and, from
    the solutions suggested, it seems that the problem is in the filter or
    in the contents of the file to be printed, but the note finishes
    without knowing the real cause of the problem.
    
    	The customer is going to do some tests in order to delimite if it
    is a filter problem or not. He's currently using the 'lg06of' filter
    and is going to test the 'lg031of' filter, and he's going to cat the 
    files directly to the device associated to the printer. I'll let you 
    know as soon as I get the results.
    
    	I know that this note should have been written after all the tests
    would have been done, but this is a very critical situation and I want
    to save time and to ask if somebody has faced this same problem.
    
    	Any help will be very, very appreciated.
    
    	Thanks in advance.
    
    	Regards.
    
    					Ana
T.RTitleUserPersonal
Name
DateLines
942.1This is not a filter problemSMURF::LABONTETue Apr 29 1997 20:4111
It is common practice for a print filter to reset the printer before and
after each file. 

The filter is counting lines to determine when to insert a form feed. To do 
this the filter must know the current state of the printer so it starts off 
with a printer reset. If the printer attributes are being changed the filter
can not be expected to operate correctly.

If the file has already been preformatted for the printer use lpr -x to
prevent filter processing of the file. This assumes that the printcap xf
option is defined as xf=/usr/lbin/xf.
942.2MORE INFO AND TESTS.IB001::ANAMARIAAna Garc�a, MCS (Madrid)Wed Apr 30 1997 17:2078
    	Hi.
    
    	Thank you very much for your answer.
    
    	Here is more information and tests about the customer problem:
    
    	- The files generated by Informix are not preformatted.
    
    	- The LG12+ is attached to the 4000 serial port (device
    '/dev/tty01').
    
    	- We have defined the 'if', 'of' and 'xf' entries to '/usr/lbin/xf'
    and done the following tests:
    
    		* lpr -x -Pprinter file
    		The file is queued but there is no output. The printer
    doesn't even receive any data.
    
    		* #lpr -Pprinter file
    		There is no output. Same as last case.
    
    		* #cat file > /dev/tty01
    		The file, although not formatted, is printed.
    
    		* #cat file | /usr/lbin/lg06of > test1.dat
    		The file is well printed, but the LinePrinter emulation is
    changed to LG, and the second job prints with the LG emulation.
    
    	If you edit the 'test1.dat' you see the following escape sequences
    in the first and last line:
    
    	^[c^[[66t^M        (in the first line)
    	^M^L^[c            (in the last line)
    
    	If we delete the last line and run:
    
    	# cat test1.dat > /dev/tty01
    
    the file prints ok but the emulation also changes.
    
    	If we delete the reset sequence (^[c) from the first line and run:
    
    	# cat test1.dat > /dev/tty01
    
    the file doesn't print.
    
    	It seems that the reset is needed for the printer to be able to
    print a new job, but it also seems that the reset is changing the
    emulation to the default one.
    
    
    	I have seen from other information that we can define the 'ff' flag
    (with the 'fo' flag) with the escape sequence we want the printer to
    execute when there is a formfeed, but I don't understand when this flag
    is taken into account, at the end of each job?, at the beginning?, each
    time there is a formfeed in the file?.  Please, give me some info about
    this issue.
    	
    	As the lg06of filter is needed, I think that the only solution is
    to modify this filter. Therefore, I'd like to have, if possible, the
    source of this filter to be able to modify it to include the escape
    sequence to enable the LinePrinter emulation and the suitable form page
    length. 
    
    	Please, could somebody tell me if this customer problem could be
    solved only with the 'ff' and 'fo' flags, or if the only solution is to
    modify the existing file?.
    
    	The situation is very critical. All the tests should be well
    thought and tested in order to have the minimal impact on the customer
    site.
    
    	Thank you very much in advance.
    
    	Regards.
    
    					Ana
    
942.3PROBLEM SOLVED.IB001::ANAMARIAAna Garc�a, MCS (Madrid)Tue May 20 1997 12:2850
    	Hi all.
    
    	I received the following information via mail from SMURF::LABONTE.
    
    .....
    
    Sorry I missed the update to note 942.
    
    The lg12+ is a multi-language printer. It supports ANSI, Epson, and
    IBM modes. It is possible to use an lg12+ printer on Digital UNIX.
    Since
    printing environments vary the functionality provided may not (will
    not)
    meet everyone's requirements.
    
    Since the files being printed are unformatted switching the printer
    default
    settings from IBM to DEC ANSI (PPL) should resolve the problem. This
    would
    be the recommended fix since ANSI support for these printers will be
    available in a future release of Digital UNIX (v4.2d?).
    
    If you want to stick to IBM mode the get the filter lpf_crlf.c
    from the web page ftp://vorpal.zk3.dec.com/html/print.html .
    Edit the file and change
    
            #define PRINTER_RESET NO_RESET
    
    To
            #define PRINTER_RESET IBM_PROPRINTER_RESET
    
    Ernie
    ....................................................................
    
    
    	As suggested, we used that filter without changing anything (the
    problem in my customer case was that the emulation selected via the
    printer display was changed due to the resets sent by the printer
    filter). The default behavour of this filter is not to do a reset.
    
    	The customer has defined two different setups in the printer, each
    for different kinds of paper and he selects one of them depending on
    the report being printed. Now, he can send two or more jobs and the
    following one begins to print at the beginning of the piece of paper.
    
    	Hope this helps. 
    
    	Thanks Ernie, again, for your help.
    
    	Regards.