How to setup Top Margin in a Post script output

From: Nagaraja, Raja <Raja.Nagaraja_at_actew.com.au>
Date: Tue, 29 Jun 1999 16:41:36 +1000

Hello Managers,
I have a problem in printing to a postscript printer. The Printout has to
come out on a pre-printed invoice and I need to push a line down, that means
increase the top margin. I am using a printer filter where in we have
defined certain parameters to be changed from standard ln03r filter. The
parameter used in ln03r filter for top margin is top-m, I do not know how to
use it in my filter to manipulate it.

Following is the output of the filter and the printcap entry that I use:

Printer: bdu_invoice
# Printer for printing Invoices
bdu_invoice|lp146|BDU_INVOICE|Bdu_Invoice:\
        :br#9600:\
        :ct=dev:\
        :fc#0177777:\
        :fs#03:\
        :if=/usr/lbin/filterinv:\
        :lf=/usr/adm/lp146err:\
        :lp=/dev/tty0q:\
        :mc#20:\
        :mx#0:\
        :of=/usr/lbin/ln03rof:\
        :pl#67:\
        :pw#80:\
        :rw:\
        :sd=/usr/spool/lpd146:\
        :sh:\
        :xc#0177777:\
        :xf=/usr/lbin/xf:\
        :xs#044000:

Filter:
#!/usr/bin/sh
#
# filterinv - designed to suit Oracle Financials forms to print invoices.
#
# 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
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=816 #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 "/\/Courier/ s/findfont .* scale/findfont $fontsize scale/" \
      -e "/\/lfsize/ s/\/lfsize .* def/\/lfsize $lfsize def/" \
      -e "/\/spsize/ s/\/spsize .* def/\/spsize $spsize def/"



I want to insert the top-m value withthe sed command so that it can
manipulate the top margin, does any one has any clue?

Thanks in advance

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 Tue Jun 29 1999 - 06:47:03 NZST

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