Bug 244979 - add page-ranges and accounting to textonly filter
Summary: add page-ranges and accounting to textonly filter
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: cups
Version: 6
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F8Target
TreeView+ depends on / blocked
 
Reported: 2007-06-20 11:55 UTC by Opher Shachar
Modified: 2007-11-30 22:12 UTC (History)
0 users

Fixed In Version: 1.2.12-1.fc8
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-07-16 11:45:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
CUPS textonly filter with page-ranges and accounting (3.48 KB, text/plain)
2007-06-20 11:57 UTC, Opher Shachar
no flags Details
CUPS textonly filter with page-ranges and accounting (3.51 KB, text/plain)
2007-07-08 13:09 UTC, Opher Shachar
no flags Details


Links
System ID Private Priority Status Summary Last Updated
CUPS Bugs and Features 2427 0 None None None Never

Description Opher Shachar 2007-06-20 11:55:26 UTC
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:

Comment 1 Opher Shachar 2007-06-20 11:57:36 UTC
Created attachment 157451 [details]
CUPS textonly filter with page-ranges and accounting

Comment 2 Opher Shachar 2007-06-26 22:11:36 UTC
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.

Comment 3 Opher Shachar 2007-06-26 23:06:13 UTC
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.

Comment 4 Tim Waugh 2007-06-27 08:45:52 UTC
(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.


Comment 5 Opher Shachar 2007-07-08 13:01:00 UTC
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.

Comment 6 Opher Shachar 2007-07-08 13:09:02 UTC
Created attachment 158730 [details]
CUPS textonly filter with page-ranges and accounting

Comment 7 Tim Waugh 2007-07-09 14:32:14 UTC
Thanks.  Fixed in CVS.


Note You need to log in before you can comment on or make changes to this bug.