Date: Tue, 22 Jan 2002 01:40:23 +0100
From: Fernando Blanco Marcilla <[EMAIL PROTECTED]>
G'day all,
This posting got me thinking....
My understanding of the ifhp filtering process for pagecounting is:
- ask the printer for a PAGECOUNT
- send the print job
- tell the printer to turn on the USTATUS PJL command.
- ask the printer for a PAGECOUNT
- keep listening to the printer connection until a PAGECOUNT is returned
Reading the PJL specification, I gathered that you could send the following
sequence to achieve the same.
<ESC>%-12345X@PJL
@PJL ECHO attempting PAGECOUNT
@PJL INFO PAGECOUNT
@PJL ENTER LANGUAGE = PCL
...
@PJL EOJ
@PJL ECHO attempting PAGECOUNT
@PJL INFO PAGECOUNT
<ESC>%-12345X
The ECHO command is suppose to synchronise the output given from the printer.
That way, you would only need to get the start and end pagecounts from the
open connection and they would almost always be correct.
or am I being gullible in thinking that the printers follow PJL strictly?
Just a thought...has anybody tried anything like this before?
Christopher
> I have done some tests with the version of ifhp 3.5.2 and the pagecount
> of HP-4100 printers, observing the messages of status that it returns
> as the job is being processed.
>
> Unfortunately, unlike other HP printers, this model gives back 'END'
> status a long before the job is completed; nevertheless, when it really
> finishes a job, the following values in Devstatus are given:
>
> job="END"
> name=Jobname (or a substring of this.)
>
> Having this behavior into account, I modified a few lines in the routine
> Do_waitend and finally I managed to count the pages correctly (at least
> in the tests I did, using it for some days with five HP-4100 and several
> other models, sending PCL files and Postscript).
>
> The modification I have done in ifhp 3.5.2 has been:
> line 2912: I added the statusname variable
> lines 3085,3088: I modified the end of job detection criterion
>
> See:
> diff ifhp.c.orig ifhp.c
> 2911c2911
> < char *sync_str, *s, *t, *u, buffer[SMALLBUFFER],
> endname[SMALLBUFFER];
> ---
> > /* */ char *sync_str, *s, *t, *u, buffer[SMALLBUFFER], endname[SMALLBUFFE
>R]; statusname[SMALLBUFFER];
> 3084c3084,3087
> < if( s && strstr(s,"END") && t &&
> strstr(t,endname) ){
> ---
> > /* hp4100 17.12.01 */ if (t) { strcpy(statusname,t+1);
> > statusname[strlen(statusname)-1]='\0';
> > }
> > /* hp4100 17.12.01 */ if( s && strstr(s,"END") && t && strstr(Jobname,sta
>tusname) ){
>
>
> This was sufficient. The statusname variable I used to remove the quotes
> that are in the first and last character of t, due to problems when the
> Jobname is too long or contains the character ','.
> It was not necessary to put pagecount_poll and pagecount_interval in the
> printcap file.
>
> As I do not know the code in depth, I do not know if this modification
> might introduce any problem that I have not taken into account.
>
> I also tried the same modification with 3.5.0 version, and it counts
> correctly too.
>
> Regards:
> Fernando Blanco.
> CIEMAT.
>
> ---------------------------------------------------------------------------
>--
> 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 impati
>ent,
> 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 wor
>d
> LPRNGLIST in the SUBJECT line.
> ---------------------------------------------------------------------------
>--
>
Christopher
,,,
(. .)
/-----.oOO--(_)--OOo.-------------------------------------------------\
| Christopher McAvaney [EMAIL PROTECTED] |
| PhD Candidate [EMAIL PROTECTED] |
| [EMAIL PROTECTED] |
| phone: +61+3+52272960 [EMAIL PROTECTED] |
| fax: +61+3+52272028 http://www.cm.deakin.edu.au/~chrismc |
\---------------------------------------------------------------------/
-----------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------