SUMMARY:Addendum: Printing only selected pages

From: Maglinger, Paul (PMAGLINGER@scvl.com)
Date: Fri Sep 20 2002 - 15:46:55 EDT


Is there a command string or script that will allow you to print select
pages or a string of pages from a text document through Tru64Unix 5.1a?
 
The following suggestions were submitted...

>From Ernie:
You need to be using either the pcfof or ppdof print filters.
The lpr option is -Opages=start:end. From the man page:
pages=start:end
Print the pages of a file within the start and end parameters. When
start is not specified, printing starts at page 0. When end is not
specified, printing continues to the end of the file.

>From Simon:
This is pretty tricky to do. The lp command won't do this, you will need
to pipe the file through some pre-processing scripts first. This is
straight forward enough if you want to print A4 size with 66 lines per
page. You read in the file line by line and break it into 66 line
segments then print the segments you want.
 
>From Lucio:
Possibly you should paginate it before into another file. Perhaps man pr
gives some advice on a standard unix command to do it. That, accompanied
by some playing with awk or grep, and piped into whatever print command
you use, could do the trick.
Otherwise just edit the file and save the part you are interested in
(manually) or, if you need to automatize, do something like
awk 'NR>xx && NR<yy' file
to select lines between xx and yy (file lines are known, pages aren't)

>From Alan:
For simple text files you can use head(1) and tail(1) to
        extract a range of lines and pass those onto a printer:

                head -100 file | tail -50 | lpr

        Assuming I got the options right, the head(1) will get
        the first 100 lines and the tail(1), the last 50 of that
        with the result being lines 51-100.

        Adobe's acrobat reader will let you select page ranges
        of PDF files. I'd expect word processing software to
        be able to do the same. I don't know of any options
        directly in lp or lpr that support this feature, but
        I've never gone looking for them. If you haven't, check
        the manual pages for whatever you're using to print the
        files.

Paul Maglinger, A+, CA, CCA, CET, MCSE
Systems Administrator Shoe Carnival Inc. (812)867-4674 pmaglinger@scvl.com



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:48:53 EDT