From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; MathPlayer 2.0; .NET CLR 2.0.50727; .NET CLR 1.1.4322; FDM; .NET CLR 3.0.04506.30) Description of problem: I hope this is the place to submit feature request/improvments... if not then my apologies. Currently the textonly filters only handles number of copies. I've attached a modified version that handles page-ranges option and does page accounting based on FF in the input file. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: New feature request. Actual Results: Expected Results: Additional info:
Created attachment 157451 [details] CUPS textonly filter with page-ranges and accounting
Hi Tim, First as to the appending of the FF to the last printed page, I concur with you. My original rational was that without this the first page of copy#2 would follow the last page of copy#1. Next, when 'unset PR' is used page accounting seems to go wrong. The man page for CUPS filter has this to say: (output to stderr) PAGE: page-number #-copies PAGE: #-pages total Adds an entry to the current PageLog. The first form adds #-copies to the job- media-sheets-completed attribute. The second form sets the job-media-sheets- completed attribute to #-pages. ...but when I was testing the _second form_ did not do as expected. So hence PR=1-999999. For my needs accurate page accounting was indispensable. Please feel free to modify the script as you see fit. Regards, Opher Shachar.
Hello again. Tim, you managed to confuse me :) This code: if (( pagenum == pl )); then echo -n "${REPLY}" >>"$TMPFILE2" # If EOF then page has no final FF [[ ! "$EOF" ]] && echo -ne '\f' >>"$TMPFILE2" echo "PAGE: $pagenum $COPIES" >&2 fi does *not* insert unwarranted FF. The 'read' command strips the delimiter (FF) form $REPLY so this code outputs it back just if it was present in the first place. If we have not reached EOF then we _must_ have encountered FF witch got stripped... Regards, Opher Shachar.
(In reply to comment #3) > The 'read' command strips the delimiter (FF) > form $REPLY so this code outputs it back just if it was present in the first > place. Ah, now I understand! Thanks for clarifying this.
Good news! Outputting Total page count does work - it was a documentation error (see STR #2427). Also modified the loop to be more eficiet by setting the FF variable: FF=$(echo -ne '\f') So I've updated my script and uploading it. Opher Shachar.
Created attachment 158730 [details] CUPS textonly filter with page-ranges and accounting
Thanks. Fixed in CVS.