tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Quinn Kerry <kquinn () goldcoast ! qld ! gov ! au>
To: tru64-unix-managers
Subject: SUMMARY2: Printing to serial printer via printse rver doing the
Date: Wed, 09 Aug 2000 02:14:00 +0000	[thread overview]
Message-ID: <96578728202701.tru64-unix-managers.marc@archive.invalid> (raw)

Follow up:

Try removing the newline to remove double-spacing.

Cheers

#include <stdio.h>

void main ()
{
    int ch;

    /* Print all stdin */
    while ((ch =3D getchar()) !=3D EOF)
    {
        putchar(ch);

        /* LF =3D CR + LF */
=20       if (ch =3D=3D '\n')
        {
            putchar('\r');
            putchar('\n');
        }
    }
}

Blom, Wayne  (9/08/2000  11:03):
>Gidday and Thanks to the list 5 replies in 5 minutes, and to Selcuk Karaca,
>Allan Simeone & Chris Ruhnke=20who provided one of the solutions that work=
ed
>and to Patrick Powell for the one I will use.
>
>There were two solutions that worked for me. The original question is at=
 the
>end;
>
>The first was that the LA120 does indeed have a setting to convert LF to
>CRLF it was buried under a non de plume in the middle of the manual under=
 a
>heading of Communication. Simply put, press and hold the SETUP key. Press
>the W key multiple times until the LED displays the number 2 (New line =3D
>LF). While still holding the SETUP key press the SHIFT and 9 keys to store
>the settings.
>
>The second solution was to use LPRng.
>By using the following format for the printcap entry the staircasing went
>away independent of the LA120 settings;
>
>lp7| Network printer on Network Print Server p-hind7:
>  :server            <- for server only
>       :filter=3D/usr/local/libexec/filters/lpf   =20   <- comes with LPRng
>       :sd=3D/var/spool/lpd/lp7:
>       :lf=3D/var/spool/lpd/lp7/log:
>       :lp=3Dpr3@p-hind7
>       :lpd=5Fbounce            <- forces the server to filter file.
>
>As we are introducing LPRng to resolve a different problem, this is the
>solution that I will be implementing.
>
>The other solutions I received follow;
>
>Ruth Belin suggested I try to use tr to modify the file before sending to
>the printer. Great idea. I tried this but was totally unsuccessful.
>
>Hoai Tran, Joe Fletcher suggested using :rp=3Dtext:\ in the printcap entry.
>Unfortunately the printserver port needs to be addressed using the :rp ent=
ry
>so this was not an option.
>
>Jim Smart suggested using remote telnet to print to the printserver. In
>house this has already been used but seems to have an annoying habit of
>going to sleep every so often. Since this printing requirement is high
>availability, I didn't consider this option.
>
>Selcuk Karaca, Allan Simeone & Chris Ruhnke suggested checking the printer
>settings for an option to manage the CRLF/LF problem
>
>My Compaq friend Toby Shallas suggested four different options including
>three of those above and additionally LPRng. I have looked into this as we
>are using both Normal LPR/LPD as=20well as LPRng.
>
>Ernie LaBonte and Alan Davis suggested using the generic=5Fansi printer se=
tup
>to resolve the problem. I tried this but to no avail.
>
>Paul Roetman suggested a print filter or creating a shell script to
>preprocess the file. I don't=20have time to try out this particular approa=
ch
>but it looks interesting.
>
>Tom Devine reminded me to test the system elsewhere. This I have done. The
>printer comes from a DEC terminal server/VMS environment where it works
>fine. Going to the Printserver/Unix environment is where the problem has
>arisen.
>
>Cy Dewhurst provided me with a prefilter which he suggested may solve the
>problem, I include it here for others benefit;
>
>#include <stdio.h>
>
>void main ()
>{
>    int ch;
>
>    /* Print all stdin */
>    while ((ch =3D getchar()) !=3D EOF)
>    {
>        putchar(ch);
>
>        /* LF =3D CR + LF */
>    =20   if (ch =3D=3D '\n')
>        {
>            putchar('\r');
>            putchar('\n');
>        }
>    }
>}
>
>Compile with:
>
>cc afilter.c -o afilter
>
>Test with:
>
>cat yourfile | afilter | lpr -Pyourprinter -h
>
>This solved the staircase but introduced double line spacing. Maybe just
>needs a little tweeking. ;-)
>
>
>
>
>-----Original Message-----
>From: Blom, Wayne
>Sent: Tuesday, August 08, 2000 3:49 PM
>To: True64 Unix Managers (E-mail)
>Subject: Printing to serial printer via printserver doing the staircase
>
>
>Gidday all,
>
>I have been trying to resolve the issue where the line printer (Ancient DEC
>LA120) connected via serial port to a print server delivers the familiar
>stair case. I know, I know, upgrade to a=20fast Laser or genicom. We are,=
 but,
>budgets are tight and these things are everywhere.
>
>Simply put the printer is only doing linefeed where I require that it do=
 a
>carriage-return/linefeed.
>
>I have scanned the archives, I have tried the man pages, I have tried the
>standard print filters but have not been able to determine how to translate
>the linefeeds into carriage-return/linefeeds.
>
>Any help would be greatly appreciated.
>
>Thanks
>Wayne Blom
>System Specialist
>Technical Development Healthcare
>F H Faulding & Co Limited
>Ground Floor
>1 Station St
>Hindmarsh SA 5007
>Ph:         +61 8 8241 8334
>FAX:      +61 8 8241 8357
>Mobile:         +61 0419 808 496
>Email:  wayne.blom@au.faulding.com
>





Kerry Quinn
Senior=20Unix Systems Administrator
Gold Coast City Council
Ph:   (07) 55 816975
Fax:  (07) 55 740700
Mob: 0414 180090
EM:  kquinn@goldcoast.qld.gov.au

**********************************************************************
This e-mail and its contents is confidential to Gold Coast City Council
and un-authorised use is strictly prohibited.
**********************************************************************

                 reply	other threads:[~2000-08-09  2:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox