Hello.
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[SMALLBUFFER];
>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,statusname) ){
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 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.
-----------------------------------------------------------------------------