Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Results - Printer filter.

2 views
Skip to first unread message

Chuck Crawford

unread,
Mar 21, 1997, 3:00:00 AM3/21/97
to

Well I finally fixed my printer problem. I just want to say thanks to the
people that had ideas, because I tried them all.

Description or problem.
To get a HP LJ4si Ethernet printer to stop printing stair step ascii
text.

Attempts to fix the probem.

I checked the setup in the /etc/printcap file to make sure the printer was
addressed correctly eg. :rp=IPaddress. - that checked out ok.

I tried reading the man page on printcap but there was not enough info to
have a clue on what parameters to use.

The HOW-TO said I needed a filter.
The PERL script in the HOW2 didn't do the trick, and the HOW-TO was about
useless from this point on. It also made me get the book out and figure
out what to do with the perl script. Who knew that I had to make it
executable.

So I tried:
apsfilter - It does not support remote printers, well at least at first
glance. It really does but its a hack liskted in the FAQ, still didnt
help.

magic-flter release .4 - did not fix the problem.

ez-magic printer filter v1.0.5 - did not fix the problem.

MAGICFILTER v1.1 again no help, but in the README.install it did tell me
that "The standard BSD print daemon does *not* support filters for remote
printers..."

It recomemded LPRng. So I tried to install LPRng. I ran into a conflict
while I was compiling. So I put that off for a later time.

So I finally gave in and asked my MIS dept for any ideas. Well they said
I needed to tell the printer to print to port 1 with the parameter LF.
I responede with the basic, HUH??
How do I do that.??

FIX:
It turns out that if I specify the :rp=portLF1, everything works fine.

I just set up 2 differnt queues for the printer. the first "lp" is the
standard ascii printer with the fix from above. Prints normal text files
just fine.

The second "ps" is the postscript queue. I just left out the :rp and it
does postscript just fine.

This is all I wanted to do.

Im not sure who controls what as far as the portLF1 is concerned.
The system consists of a 10baseT line into a EXTENDED SYSTEMS, ExtendNet
MPX ESI-2810. Then into the HP LaserJet 4si.

Things are working fine now, thanks for all the help.

Until next time.

Chuck Crawford.
chu...@telerama.lm.com

Jonathan Guthrie

unread,
Mar 21, 1997, 3:00:00 AM3/21/97
to

In comp.os.linux.networking Chuck Crawford <chu...@telerama.lm.com> wrote:

> Well I finally fixed my printer problem. I just want to say thanks to the
> people that had ideas, because I tried them all.

> Description or problem.
> To get a HP LJ4si Ethernet printer to stop printing stair step ascii
> text.

You need to process your output through a filter that adds a carriage-return
for each linefeed.

I normally print stuff through a filter I wrote in C that looks like this:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void add_file(FILE *infile, FILE *outfile)
{
int c;

while(!feof(infile))
{
c = getc(infile);
if(EOF != c)
{
putc(c, outfile);
if('\n' == c)
{
putc('\r', outfile);
}
}
}
}


void add_file_by_name(char *in_filename)
{
char *out_filename;
FILE *infile, *outfile;

out_filename = malloc(strlen(in_filename) + 100);
strcpy(out_filename, in_filename);
strcat(out_filename, ".dos");
if(NULL != (infile = fopen(in_filename, "r")))
{
if(NULL != (outfile = fopen(out_filename, "w")))
{
add_file(infile, outfile);
}
else
{
printf("Unable to open the output file \"%s\"\n",
out_filename);
}
}
else
{
printf("Unable to open the input file \"%s\"\n", in_filename);
}
}


int main(int argc, char **argv)
{
int i;

if(argc < 2)
{
add_file(stdin, stdout);
}
else
{
for(i=1; i<argc; ++i)
{
add_file_by_name(argv[i]);
}
}
return EXIT_SUCCESS;
}

This is a pretty kludgy program (my "stripcr" program is much better at
converting bunches of files) but it works well enough as a filter.

To build it, save the source code as "addcr.c" and then type
"gcc -o addcr addcr.c"

I always use it by using anonymous pipes, like this:

addcr < FILENAME | lpr

where you would replace FILENAME with whatever file name you wanted to
print.

HTH, etc.
--
Jonathan Guthrie (jgut...@brokersys.com)
Information Broker Systems +281-895-8101 http://www.brokersys.com/
12703 Veterans Memorial #106, Houston, TX 77014, USA

We sell Internet access and commercial Web space. We also are general
network consultants in the greater Houston area.


0 new messages