I have looked over this,  and will add the patch.

Note:

While this patch is reasonable and will work,  end of job detection
may may fail if there are embedded PJL JOB information in the file.
If this is the case,  then the original PJL JOB will get overriden
(overrode?) by the embedded PJL JOB lines.

This why the 'dummy job at the end' was to added - make sure that
some sort of PJL JOB/PJL END causes the end of job detection to
fail.

Patrick

> From [EMAIL PROTECTED] Wed Oct 16 16:59:44 2002
> Date: Wed, 16 Oct 2002 17:56:48 -0500
> From: "Raymond M. Reskusich" <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: LPRng: patch to fix waitend and pagecount problems for hp4100 and hp4550n 
> printers
>
>
> --SFyWQ0h3ruR435lw
> Content-Type: multipart/mixed; boundary="TiqCXmo5T1hvSQQg"
> Content-Disposition: inline
>
>
> --TiqCXmo5T1hvSQQg
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
> Content-Transfer-Encoding: quoted-printable
>
> Let me say up front, I am new to the mailing list.  I'm also not an
> expert on PJL, so some of my comments will probably be naive or just
> plain wrong.  I have written a patch based on an earlier one by
> Fernando Blanco Marcilla to fix the waitend/pagecount problems
> frequently mentioned on this list for the hp4100 printer.  I found the
> same problems occuring on the hp4550n printer, for which I needed a
> fix quickly.  If it turns out to be useful, I'd be glad to see it
> merged into the main source, as I think many people are having this
> problem.
>
> In the attached patch, I added a new configuration flag
> "pjl_waitend_byjobname" that will allow the fix to be activated on a
> per-model or per-printer basis.  It is a unified diff to ifhp-3.5.10.
> To apply it, run the following from the top level of the distribution:
>
> 'patch -p1 < ifhp.patch'
>
> Give it a try and let me know what you think.
>
> I've included some details so that the printing experts on this list
> can tell me if I'm making sense, but anything from here on is
> unneccessary if you just want to use the patch.
>
> The way the waitend=3Dpjl ssystem seems to work on many printers seems
> to follow a timeline something like this:=20
>
> 1. ifhp submits the user's job:
> @PJL JOB NAME =3D "reskusic (STDIN):thehut" ...
>
> 2. ifhp submits an empty job with a name like "16-24-44.737 PID 24583"
> @PJL JOB NAME =3D "16-24-44.737 PID 24583"
>
> 3. ifhp waits for the "16-24-44.737 PID 24583" to complete
>
> 4. the printer sends back infomation about the end of the jobs
> END^M
> NAME=3D"reskusic (STDIN):thehut"^M
> PAGES=3D1^M
> =2E..
> END^M
> NAME=3D"16-24-44.737 PID 24583"^M
> PAGES=3D0^M
>
> 5. ifhp checks the final pagecounter and does accounting.  This works
> because the printer finishes "reskusic (STDIN):thehut" before starting
> on the empty job "16-24-44.737 PID 24583".
>
> What happens in the old code when used on the hp4550n(or probably
> 4100) is more like this:
>
> 1. ifhp submits the user's job:
> @PJL JOB NAME =3D "reskusic (STDIN):thehut" ...
>
> 2. ifhp submits an empty job with a name like "16-24-44.737 PID 24583"
> @PJL JOB NAME =3D "16-24-44.737 PID 24583"
>
> 3. ifhp waits for the "16-24-44.737 PID 24583" to complete
>
> 4. the printer, seeing "16-24-44.737 PID 24583" is empty, reports that
> it is done without waiting
> END^M
> NAME=3D"16-24-44.737 PID 24583"^M
> PAGES=3D0^M
>
> 5. ifhp checks the pagecounter, gets erroneous data, and does bad
> accounting
>
> 6. "reskusic (STDIN):thehut" finishes, and the printer reports back
> END^M
> NAME=3D"reskusic (STDIN):thehut"^M
> PAGES=3D1^M
>
> Which is the reason for the bad page counts and the early exits.  The
> way the patch works is more like this:
>
> 1. ifhp submits the user's job:
> @PJL JOB NAME =3D "reskusic (STDIN):thehut" ...
>
> 2. ifhp waits for the "reskusic (STDIN):thehut" to complete
>
> 3. "reskusic (STDIN):thehut" finishes, and the printer reports back
> END^M
> NAME=3D"reskusic (STDIN):thehut"^M
> PAGES=3D1^M
>
> 4. ifhp checks the final pagecounter and does accounting.
>
> I feel a little uneasy about removing the empty job, but in the
> context of this printer I can't see any reason for it.  Any opinions?
>
> Raymond M. Reskusich
>
> --TiqCXmo5T1hvSQQg
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: attachment; filename="ifhp.patch"
> Content-Transfer-Encoding: quoted-printable
>
> diff -u -r ifhp-3.5.10/ifhp.conf.in ifhp-3.5.10-ewshack/ifhp.conf.in
> --- ifhp-3.5.10/ifhp.conf.in  2002-07-22 11:19:02.000000000 -0500
> +++ ifhp-3.5.10-ewshack/ifhp.conf.in  2002-10-16 17:18:56.000000000 -0500
> @@ -76,6 +76,7 @@
>  ### hp2500cm - HP Design Jet 2500cm - PCL and PostScript
>  ### hpdj2500cp - HP DesignJet 2500CP, not HP2500, HP2500c, HP2500cm
>  ### hp4500 - HP Color LaserJet Printer 4500
> +### hp4550n - HP Color Laserjet 4550n
>  ### hp8500 - HP Color LaserJet Printer 8500
>  ### hp8550 - HP Color LaserJet Printer 8550
>  ### hp5000 - HP5000  Model number: C4111A (LaserJet 5000N)
> @@ -2338,7 +2339,7 @@
> =20
> =20
>  # PRINTER % - HP Color LaserJet Printer {/hp(.*)/$1/}
> -[ hp4500 hp8500 hp8550 ]
> +[ hp4500 hp8500 hp8550 hp4550n]
> =20
>  # Apparently this printer does not like ^D at start of job
>  ps_eoj_at_start@
> @@ -2438,6 +2439,11 @@
>       lduplex sduplex tumble shortedge
>  ]
> =20
> +# PRINTER hp4550n - HP4550N=20
> +[ hp4550n ]
> +# to fix waitend
> +pjl_waitend_byjobname
> +
>  # PRINTER hp5000 - HP5000  Model number: C4111A (LaserJet 5000N)
>  #
>  # Hewlett Packard 5000 Series
> diff -u -r ifhp-3.5.10/src/ifhp.c ifhp-3.5.10-ewshack/src/ifhp.c
> --- ifhp-3.5.10/src/ifhp.c    2002-07-22 11:19:05.000000000 -0500
> +++ ifhp-3.5.10-ewshack/src/ifhp.c    2002-10-16 17:41:36.000000000 -0500
> @@ -3309,13 +3309,20 @@
> =20
>       DEBUG1("Do_waitend: endname '%s'", endname );
> =20
> +     if ( Pjl_waitend_byjobname )
> +             strcpy(endname, Jobname);
> +
>   again:
> =20
>       Init_outbuf();
>       if( use_pjl ){
>               Put_outbuf_str( PJL_UEL_str );
>               Put_outbuf_str( PJL_str );
> -             if( use_job ){
> +             if ( Pjl_waitend_byjobname )
> +             {
> +                     /* do nothing, just wait for the end of the real job */
> +             }
> +             else if( use_job ){
>                       buffer[0] =3D 0;
>                       len =3D safestrlen(buffer);
>                       SNPRINTF(buffer+len, sizeof(buffer)-len) Jobreset_str);
> diff -u -r ifhp-3.5.10/src/ifhp.h ifhp-3.5.10-ewshack/src/ifhp.h
> --- ifhp-3.5.10/src/ifhp.h    2002-07-22 11:19:05.000000000 -0500
> +++ ifhp-3.5.10-ewshack/src/ifhp.h    2002-10-16 17:18:50.000000000 -0500
> @@ -213,6 +213,8 @@
>       Pjl_console,    /* use the PJL Console */
>       Pjl_display_size,       /* use the PJL Console */
>       Pjl_enter,      /* use the PJL ENTER command */
> +     Pjl_waitend_byjobname,  /* wait for the specific job name string with the
> +                                end of job string */
>       Reopen_for_job, /* open the device read/write */
>       Ps,                     /* has PostScript support */
>       Psonly, /* only recognizes PostScript */
> diff -u -r ifhp-3.5.10/src/vars.c ifhp-3.5.10-ewshack/src/vars.c
> --- ifhp-3.5.10/src/vars.c    2002-07-22 11:19:06.000000000 -0500
> +++ ifhp-3.5.10-ewshack/src/vars.c    2002-10-16 17:18:50.000000000 -0500
> @@ -54,6 +54,7 @@
>      {  "Pjl_display_size", "pjl_display_size", (char **)&Pjl_display_size,=
>  INTV,0 },
>      {  "Pjl_done_msg", "pjl_done_msg", &Pjl_done_msg, STRV ,0 },
>      {  "Pjl_enter", "pjl_enter", (char **)&Pjl_enter, FLGV,0 },
> +    {  "Pjl_waitend_byjobname", "pjl_waitend_byjobname", (char **)&Pjl_wai=
> tend_byjobname, FLGV, 0},
>      {  "Pjl_ready_msg", "pjl_ready_msg", &Pjl_ready_msg, STRV ,0 },
>      {  "Ps", "ps", (char **)&Ps, FLGV,0 },
>      {  "Ps_ctrl_t", "ps_ctrl_t", (char **)&Ps_ctrl_t, FLGV,0 },
>
> --TiqCXmo5T1hvSQQg--
>
> --SFyWQ0h3ruR435lw
> Content-Type: application/pgp-signature
> Content-Disposition: inline
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.7 (GNU/Linux)
>
> iD8DBQE9re6rzP7ZiwdVm5sRAgDmAJkBHeD0sVEPO83KUXeT3+wgiR9A/gCeMTSB
> KixZfzJJav/K/eYnuhWXP8I=
> =g8Eg
> -----END PGP SIGNATURE-----
>
> --SFyWQ0h3ruR435lw--
>
> -----------------------------------------------------------------------------
> 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.
> -----------------------------------------------------------------------------
>

-----------------------------------------------------------------------------
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