Bug 244979 - add page-ranges and accounting to textonly filter
add page-ranges and accounting to textonly filter
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: cups (Show other bugs)
6
All Linux
low Severity low
: ---
: ---
Assigned To: Tim Waugh
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks: F8Target
  Show dependency treegraph
 
Reported: 2007-06-20 07:55 EDT by Opher Shachar
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version: 1.2.12-1.fc8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-07-16 07:45:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
CUPS Bugs and Features 2427 None None None Never

  None (edit)
Description Opher Shachar 2007-06-20 07:55:26 EDT
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 07:57:36 EDT
Created attachment 157451 [details]
CUPS textonly filter with page-ranges and accounting
Comment 2 Opher Shachar 2007-06-26 18:11:36 EDT
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 19:06:13 EDT
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 04:45:52 EDT
(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 09:01:00 EDT
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 09:09:02 EDT
Created attachment 158730 [details]
CUPS textonly filter with page-ranges and accounting
Comment 7 Tim Waugh 2007-07-09 10:32:14 EDT
Thanks.  Fixed in CVS.

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