[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Wordperfect and LaserJet 6L



>> One possibility is that wordperfect is printing the command
>> 'switch to postscript mode' before it begins the postscript
>> output; some of the drivers for HP 4000 printers do this
>> (two lines of pjl, 400+ lines of psotscript, 2 lines of pjl).
>> If this is the case, you can write a small filter to remove
>> the pjl commands from top and bottom, and set up a second 
>> printer in /etc/printcap that has a filter set to strip
>> the pjl, and then pass on the rest to he normal printer.
>
>i'm not sure exactly how to do this, but i'm sure i can find it in the manpage
>s. However, i was using wordperfect on redhat 5.2 a few months back, and I did
>n't have this problem. At the time, i used their printtool gui to choose my pr
>inter....why would it work on rh but cause problems in debian?

here's a perl hack (out of my head, so you may have to fix any
syntax problems):

--cut
#!/usr/bin/perl

# put this in /etc/printcap instead of the normal magicfilter
# to catch before/after glimpses of what's happening

#change this to match the desired 'real' filter
$magicfilter = "/bin/true";

use IPC::Open2;

open LOG_PRE_FILTER, ">/tmp/filter.$$.before"
  or die "Can't open file: $!\n";

open LOG_POST_FILTER, ">/tmp/filter.$$.after"
  or die "Can't open file: $! \n";

open2(FROM_FILTER, TO_FILTER, $magicfilter) 
  or die "Error opening filter: $! \n";

# turn off buffering on our side of filter
select LOG_FILTER_IN;
$| = 1;

while ( defined(<STDIN> ))
{
  print LOG_PRE_FILTER;
  print TO_FILTER;
}

close LOG_PRE_FILTER;
close TO_FILTER;

while ( defined(<FROM_FILTER>))
{
  print LOG_POST_FILTER;
  print STDOUT;
}

close LOG_POST_FILTER;
close FROM_FILTER;

--- cut


make sure this runs (from the command line) then put it in /etc/printcap.
Print something the normal way, then print something in WP, and compare the
resutling files in /tmp ( or shar them and mail them to me) and see what
is happening.

Carl


Reply to: