[comp.windows.ms] possible to print a text border?

lrb@alex.ctrg.rri.uwo.ca (Lance R. Bailey) (05/30/91)

>Is there some way to extend the header/footer "concept" to include text 
>running along the left & right sides of the page ... basically a text border?

well i did this in w4dos a wwhile back, w4w is just out of the box so i'll have
to assume that you can do the same.

create a running head/footer which contains a graphic image (i use PostScript
code, hand written). When the running is printed, so is the graphic.

I used this to create "SECTION N" in black-on-white text down the edge of the
paper. I had two running heads, one for even pages (text on left) and one 
for odd pages (text on the right).

the following is the PostScript to do it,

%!
/lrbfh 8 def

/Courier findfont lrbfh scalefont setfont
/Helvetica findfont lrbfh scalefont setfont

/lrbboxwidth (a) stringwidth pop 4 add def

/lrbbordershow   % [ leftside | string
{   /lrbstr exch def
    /lrbleftside exch def

    lrbstr dup length 1 sub get 48 sub 72 mul 738 exch sub /lrby exch def

    0.2 setgray

    lrbleftside
    {   newpath
        /lrbx 18 lrbboxwidth add def
        lrbx lrby moveto
        lrbboxwidth -1.5 mul 0 rmoveto
        lrbboxwidth 2 mul 0 rlineto
        lrbstr length 1 sub lrbfh mul lrbfh 0.3 mul add neg 0 exch rlineto
        lrbboxwidth -2 mul 0 rlineto closepath
        gsave fill grestore 0 setgray 0 setlinewidth stroke
    }
    {   newpath
        /lrbx 594 lrbboxwidth sub def
        lrbx lrby moveto
        lrbboxwidth 1.5 mul 0 rmoveto
        lrbboxwidth -2 mul 0 rlineto
        lrbstr length 1 sub lrbfh mul lrbfh 0.3 mul add neg 0 exch rlineto
        lrbboxwidth 2 mul 0 rlineto closepath
        gsave fill grestore 0 setgray 0 setlinewidth stroke
    }
    ifelse

    0 setgray % black  (swap these lines to play with
    1 setgray % white   black on white or white on black)

    /lrbcc (0) def
    lrbx lrby moveto
    {   exch pop lrbx lrby moveto 0 lrbfh neg rmoveto
        currentpoint /lrby exch def /lrbx exch def
        lrbcc exch 0 exch put lrbcc stringwidth pop 2 div neg 0 rmoveto
    } lrbstr kshow
} def

/lrbleftborder { true exch lrbbordershow } def
/lrbrightborder { false exch lrbbordershow } def

( SECTION 1) lrbleftborder

-- 
Lance R. Bailey  Systems Manager        box: Robarts Research Institute
          email: lrb@rri.uwo.ca              Clinical Trials Resources Group
            fax: 519.663.3789                P.O. Box 5015, 100 Perth Dr.
            vox: 519.663.3787 ext. 4108      London, Canada N6A 5K8

gg2@cunixf.cc.columbia.edu (Guy Gallo) (05/31/91)

Lance,

I've done a similar thing to your left border PSScript macro.  It prints
DRAFT or COPY diagonally across a page.  I wrote a WFW macro to insert
the proper Print field (a print field ships a string to the printer as
a literal so that you can directly manipulate the printer).

I will try and adapt your Section N macro...

The orginal request was not nearly so complex (and should be possible with
any printer).  You just define the paragraph of the header with the appropriate
left indent, set it's border to left, and set it's height to the height you
want the line to span the page... documented on page 21 of the reference.