Summary-- How to setup Top Margin in a Post Script output

From: Nagaraja, Raja <Raja.Nagaraja_at_actew.com.au>
Date: Thu, 08 Jul 1999 09:53:07 +1000

Hello Managers,

I solved the problem by using a sed command. I received one answer from
Gordon Lawson who suggested to:
Simply "find" line one
and replace it with line one AND a newline.
This example will add a newline after the first
line at the top of the file and save it to another
file:
sed 1G input.file > output.file
I did not want to change in application. Later I modified the filter and it
worked with a larger top margin.
Following is the filter:
# expand expands tabs before file re-formatting to retain correct tabbing.
# The first sed command inserts the offset, then prevents insertion of
spurious
# lines by restoring a form feed to the front of any lines that originally
# started with one. (ff is expanded to ff cr)
# The second sed takes the output from the postscript filter and edits more
# appropriate parameters into it.
#
PATH=/usr/bin:$PATH
filter=/usr/lbin/ln03rof
#filter=/usr/lbin/hplaserpsof
if echo $*|grep landscape > /dev/null 2>&1
  then
    indent=" " #centre 132 wide jobs. DON'T use lpr -iN to offset
    ysize=792 #retain top margin hardcoded into ln03rof
    fontsize=9.23 #select a font size for 132 char x 67 lines,landscape
    lfsize=8.06 #set the line space size to get 67 lines
    spsize=5.13 #set backspace size - used for overtyping to get bold
  else
    indent="" #insert nothing: use -iN to offset
    ysize=700 #reduce top margin hardcoded into ln03rof
    fontsize=12.00 #select a font size for 80 char x 67 lines, portrait
    lfsize=12.00 #set the line space size to get 67 lines
    spsize=6.25 # backspace size = fontsize / 1.8
fi
cat|expand|sed -e "s/^/$indent/" \
               -e "s/^${indent}
                               /
                                $indent/"|$filter $*|\
   sed -e "/portrait/ s/792/$ysize/" \
       -e "/top-m/ s/0.50/1.00/" \
      -e "/\/Courier/ s/findfont .* scale/findfont $fontsize scale/" \
      -e "/\/lfsize/ s/\/lfsize .* def/\/lfsize $lfsize def/" \
      -e "/\/spsize/ s/\/spsize .* def/\/spsize $spsize def/" \

Raja


B.S. (Raja) Nagaraja
Systems Support Specialist
Systems Management Section
Business Systems Division
ACTEW Corporation
GPO BOX 366
CANBERRA, ACT 2601
AUSTRALIA
Phone: 612 6270 7443 Fax: 612 6270 7445
MailTo:Raja.Nagaraja_at_actew.com.au
Received on Wed Jul 07 1999 - 23:55:16 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:39 NZDT