Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > Printing over TCP/IP: lpr.exe somewhat broken ?
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 22nd June 23:04
sa.deutscher
External User
 
Posts: 1
Default Printing over TCP/IP: lpr.exe somewhat broken ?



Howdy,

still trying to print from Warp 4 fp 15 over tcp/ip to a
multi-emulation printer.

The problem:

When lpr.exe is taking input from stdin, the -b (binary) flag is
ignored, resulting in garbled output.


The situation:

This time I am trying to print a simple ascii text file, for fun a
fortran code sniplet.

Printing it just like that (note I am using tcsh)

[271] D:/tmp> lpr fntest.f
Trying LPD print server 192.168.69.254, device lpt1.
Printing fntest.f
298 bytes. The entire do***ent was sent.

Results in the known CR/LF issue: I do get a LF at the end of line but
no CR, so after three or four lines the text runs diagonally off the
page, sometimes it does not even bother to send any output at all.

Telling it to send the file as binary:

[271] D:/tmp> lpr -b fntest.f
Trying LPD print server 192.168.69.254, device lpt1.
Printing fntest.f
314 bytes. The entire do***ent was sent.
[273] D:/tmp>

It actually submits the CR/LFs and prints as expected.

Now, printing from within my news reader (slrn) is accomplished by
piping an article to a command. Howver, piping it to 'lpr' or 'lpr -b'
both results in the running off the page behaviour.

It seems that lpr ignores the '-b' option when taking input from stdin,
or it simply cannot open stdin in binary mode.
A quick check without slrn confirms this suspicion:


[346] D:/tmp> cat fntest.f | lpr -b
Trying LPD print server 192.168.69.254, device lpt1.
A filename was not specified. Input from stdin will be printed.
You may need to press 'Ctrl C' to escape.
Printing d:/tmp/\lpr0003
298 bytes. The entire do***ent was sent.

Note how here it transfers only 298 bytes, in spite of the -b switch.

[347] D:/tmp> lpr -b fntest.f
Trying LPD print server 192.168.69.254, device lpt1.
Printing fntest.f
314 bytes. The entire do***ent was sent.
[348] D:/tmp>

When printing directly with -b rather than from stdin, it transfers all
314 bytes the file claims to have (see also below).

[348] D:/tmp> ls -l fntest.f
-rw-rw---a 314 May 10 23:33 fntest.f
[349] D:/tmp>


Now, is there a better lpr.exe out there or do I have to cook up a shell
or REXX script (a la write to tmp file, send tmp file with -b, remove
tmp file)?

I know of lpr32 on hobbes, but it needs TCP/IP 4.21, which I believe
his machine does not have.


Pointers are welcome, as ususal.

thanks in advance & Cheese, Stefan
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666