On Fri, 2003-02-28 at 22:25, David Fetrow wrote:
>  I'd be very interested in your solutions if any.

In the end I implemented a small perl script that removes the incomplete
PJL command from the job. For completeness, I've included the basic
script added to the filter pipeline:

#!/usr/bin/perl -w
#
# pjlflt - remove nasty bits of PJL code  
#
while (<STDIN>) {
        if (m/\c[/) {
                if (s/\c[[^(%\-12345X)]//g || s/\c[$//g) {
                        print STDERR "NASTY PJL CODE REMOVED!!\n";
                }
        }
        print;
}
1;

I'll eventually get round to re-writing this script in C to speed things
up a bit, but as it stands the performance is not too bad. The server
machines are fairly powerful so it usually takes about 2-3s to scan a
50mb file, which is acceptable in our situation. 

BTW. if anyone has any suggested C code or better perl code, I would be
very interested to hear from you.

Cheers,

sam

> 
>  I have been known to simply skip the ifhp altogether
>  and just use lprng raw. This typically works as long
>  as I don't need the ifhp features.
> 
>  What makes that practical here is the problem seems
>  to be restricted to only a few printers (possibly
>  some drivers are worth than others?)
> 
>  It's a reasonable approach to take if your accounting
>  needn't be too precise and you don't use the nifty
>  features in ifhp and just want paper to come out with
>  marks on it.
> 
> ------------------------------------------------------------
> David Fetrow                             Phone: 206 616-0869
> Distributed Computing Services           Pager: 206 405-5377
> Applied Physics Lab, Univ. of Washington
> 
> On 27 Feb 2003, Sam Lown wrote:
> 
> > Hello,
> >
> > Does anyone have any experience with this particular error message?
> >
> > getting end using 'pjl job/eoj' at <time>
> > error = 'undefined' at <time>
> > Error: 'undefined'; OffendingCommand: ^[ at <time>
> >
> > I've managed to find the source and reason for the error message,
> > however I can't decide on the best way to solve it (or at least, the
> > most practical way!) I'm upgrading the print service from the old
> > CTI-IFHP to the new ifhp, the old CTI version just ignored these error
> > messages, however the new ifhp takes more notice and tends to mess up
> > the accounting!
> >
> > The error occurs when a job printed from a windows machine and includes
> > 'drips and drabs' of PJL code - all jobs are (should be) PostScript and
> > the error is seemingly random. For some reason the windows driver
> > (sometimes) decides to add a ^[ (ESC) character to the end of the job
> > and miss out the important PJL '%-12345X' section of the command - were
> > as other times it includes the complete command, or nothing at all....
> >
> > My best solution is to add a small C/perl program to the filter pipeline
> > to throwout any incomplete commands with the escape character.
> >
> > Does anyone know of a better way to correct the crappy windows PS code?
> > Is there anything 'built-in' in ifhp to handle this? or if anyone knows
> > what could be done with the windows drivers, that would help!
> >
> > Thanks in advance,
> >
> > sam
> >
> > --
> > CERN, Geneva
> > IT - Product Support - Unix Infrastructure
> > E-mail: [EMAIL PROTECTED]
> >
> >
> > -----------------------------------------------------------------------------
> > YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
> > The address you post from MUST be your subscription address
> >
> > If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
> > or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
> > to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
> > with:                           | example:
> > subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
> > unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]
> >
> > If you have major problems,  send email to [EMAIL PROTECTED] with the word
> > LPRNGLIST in the SUBJECT line.
> > -----------------------------------------------------------------------------
> >
-- 
CERN, Geneva 
IT - Product Support - Unix Infrastructure
E-mail: [EMAIL PROTECTED]


-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to