lpr.txt for Thomas' lpr remote printing client.                    1998-11-10



Installation

Provided STinG is running and you can ping the remote machine you need to do 
the following to run lpr.ttp :

-	Make sure the lpd spooling daemon is running on the remote host

-	Insert a variable PRINTHOST in STinG's default.cnf file. 
	PRINTHOST may be something like blahost.anydomain or a dotted quad 
	like 192.168.1.1 for example. See sting.hyp for help on default.cnf.
	I propose to put PRINTHOST at the end of default.cnf where it says: 
	here starts the client stuff and you may want to add a comment 
	"Used by TRlpr:"

-	Make sure you have the variables USERNAME and HOSTNAME set in your 
	default.cnf. You may use environment variables as well; 
	see lpr-man.txt

-	Set the environment variable PRINTER to the name of the printer 
	(a queue to be precise) on the remote host or use the command line 
	option -Pprinter.


If you run the MagiC TOS compatible operating system you may in addition also 
install the device driver lp.dev :

-	Copy lp.dev to the location indicated in you MagiC manual. E.G.
	C:\GEMSYS\MAGIC\XTENSION

-	Make shure you have set the environment and/or default.cnf variables
	mentioned above in such a way that you can use lpr.ttp *without* further
	command line options.
	This is vital because lp.dev relies on the same settings.

-	Do a reboot. You should see now a new device called  lp  in the directory
	u:\dev

-	Test the device driver by copying a small file (that you would normally
	supply to lpr.ttp) to u:\dev\lp . Example using the Mupfel shell:
	  cp anyfile u:\dev\lp
	If that prints well...

-	Redirect GDOS/NVDI printing to the "file" u:\dev\lp . This can be effected
	by modifying the output file in the NVDI printer device CPX as decribed in the
	NVDI manual.
	Whether this redirection also works for methods that print without GDOS/NVDI
	has yet to be tested.

-	Printing from an application that uses GDOS should now go right away over the
	network to the remote printer.


License & copyright

This lpr package is freeware. I allow you to use and distribute it freely 
under the condition that you do not change the package in any way without 
my explicit consent.
(c) Copyright Dr. Thomas Redelberger 1998, 1999.



Disclaimer

This package is provided to you as is. I do not guarantee any features nor 
do I take any responsibility for any damage or loss you may suffer when using 
this software.



Requirements & Limitations

You must use Peter Rottengatter's STinG TCP/IP software. Without STinG this 
software is useless. STiK will *not* do because it does not allow to specify 
ports for clients.

I developed and tested lpr with the following configuration:

-	STinG v 1.12 running SLIP via Modem1 on an 4MB 260ST under MagiC 5.11
-	STinG v 1.20 running my own ethernet driver on a custom built NE2000 adapter
	on an 4MB 260ST under MagiC 5.11
-	Lpd running on a PC under OS/2 Warp 4 with built-in TCP/IP
-	Lpd running on a PC under SuSE Linux 5.3
-	HP Deskjet 690C connected to the PC

I welcome any notice on which platforms it does run.
I do not welcome any notice on which platforms it does not run ;-) .

This lpr complies with RFC1179. However it does not use a printcap file. 
Hence input filtering is not available.


Hints

If lpr is working well from the command line, you may want replace print.ttp 
from MagiC with lpr.ttp in MagiC's configuration. Thus you can print files 
by drag and drop on MAGXDESK's printer icon. Similar results can be obtained 
with other shells.

When using NVDI (as I do) or similar software you can easily redirect GDOS 
printing to a file. If no filtering on the remote host is active you need to 
print through the *same type* of GDOS printer to a file that you later 
submit the *same type* of remote printer.

As I added now the device driver lp.dev to this package you may now print
directly to the "file" u:\dev\lp without the need to create an intermediate
file.


As far as I know there are two ways to print from GEMDOS:
- Open, write and close the PRN device
- Writing to PRN with Cprnout
Another way is Bconout to PRN from the BIOS.
The latter two require a semiautomatic capturing because you do not know 
when printing is finished. I know of old programs to do this but I am unsure 
if they work properly under MagiC.
For the first way the issue is if and how a redirection from PRN to u:\dev\lp
can be done.
I would be grateful if somebody gave me advice on this issues.

If you do want a filtering happen, for example you send an ASCII file with 
lpr and the remote host should convert to Postscript before print, you need 
to configure the lp-daemon (lpd) at the remote host. A good description of 
this can be found in the Linux documentation or the periodical c't 17/98 
page 190.



History

Version		From		What
0.90B		1998-11-10	First release, beta
1.00B		1999-11-08	Fixed bug in lpr.ttp cFA file (added the 'd')
				Added lp.dev

Contact Information

Suggestions, bug reports, flames are welcome

	Dr. Thomas Redelberger
FAX:	+49 6023 999410
EMail:	thomas_redelberger@exchange.de

