[comp.lang.postscript] 'draft' background for documents

esf00@uts.amdahl.com (Elliott S. Frank) (06/07/89)

About a month ago, someone posted some Postscript that would print
'draft' or 'confidential' in large grey letters as the background for
a text document.

Could some one who saved the technique please e-mail it to me, or re-post
it?

Thanks (as usual, in A Dvance)

Elliott Frank      ...!{hplabs,ames,sun}!amdahl!esf00     (408) 746-6384
               or ....!{bnrmtv,drivax,hoptoad}!amdahl!esf00

[the above opinions are strictly mine, if anyone's.]
[the above signature may or may not be repeated, depending upon some
inscrutable property of the mailer-of-the-week.]
-- 
Elliott Frank      ...!{hplabs,ames,sun}!amdahl!esf00     (408) 746-6384
               or ....!{bnrmtv,drivax,hoptoad}!amdahl!esf00

[the above opinions are strictly mine, if anyone's.]
[the above signature may or may not be repeated, depending upon some
inscrutable property of the mailer-of-the-week.]

tomj@oakhill.UUCP (Tom Johnson) (06/08/89)

In article <919D025R327r01@amdahl.uts.amdahl.com> esf00@uts.amdahl.com (Elliott S. Frank) writes:
>About a month ago, someone posted some Postscript that would print
>'draft' or 'confidential' in large grey letters as the background for
>a text document.
>
>Could some one who saved the technique please e-mail it to me, or re-post
>it?
Here it is.  If you put this into a MSWord document header, it will print
on all pages of a document.  If you put it on a page, it will print on
just that page.  Note that once this is types in, you must select the
entire postscript script, and then go to the Define Styles menu and
type the word "PostScript" in the style box.  (this is a pre-defined
but normally hidden style for word.)

	/Times-Bold findfont
	96 scalefont setfont
	.95 setgray
	newpath
	275 200 moveto
	30 rotate
	(DRAFT) show

Good luck.

tomj@oakhill.UUCP (Tom Johnson) (06/08/89)

In article <919D025R327r01@amdahl.uts.amdahl.com> esf00@uts.amdahl.com (Elliott S. Frank) writes:
>About a month ago, someone posted some Postscript that would print
>'draft' or 'confidential' in large grey letters as the background for
>a text document.
>
>Could some one who saved the technique please e-mail it to me, or re-post
>it?
>
>Elliott Frank      ...!{hplabs,ames,sun}!amdahl!esf00     (408) 746-6384

Here it is.  If you use this with MSWord, you must format it with the style
"PostScript".  If you put it in a document header, it will print on every
page.  If it is put on a page, it will just print on that page.

/Times-Bold findfont
96 scalefont setfont
.95 setgray
newpath
275 200 moveto
30 rotate
(DRAFT) show

Good Luck.

--tomj

zben@umd5.umd.edu (Ben Cranston) (06/08/89)

This is not the version that was posted a month ago; if anybody is sending
that to the original poster please mail to me also.  This is just the code
to actually do it, one could wrap it in a redefined showpage to do it for
each page in a postscript file.

This code takes an arbitrary string and an arbitrary rectangle.  There is
some strange interaction with the setscreen stuff that makes the orientation
of the screen a little off from the orientation of the text.  If ANYBODY can
suggest a way to fix this I would be quite grateful!

Anyway, you translate to the lower left corner of the rectangle, then push
the coordinates of the upper right corner and the text onto the stack.  Then
you call the "sash" operator.  See the test program at the end.

%!PS-Adobe

% width height (string) sash
%                       ----

/sash {
	gsave
	3 1 roll 2 copy exch atan
	neg currentscreen 3 1 roll pop 3 -2 roll setscreen 
	currentscreen pop neg 5 1 roll pop
	2 div exch dup 3 1 roll 2 div exch translate
	/Helvetica-Bold findfont dup setfont 4 1 roll
	1 index stringwidth pop div 2 index cos div .8 mul
	4 -1 roll 1 index scalefont setfont 3 -1 roll rotate
	exch dup stringwidth pop -2 div 3 -1 roll -2.5 div moveto
	.9 setgray show
	grestore
} bind def

% main program

gsave
	25 25 translate
	500 700 (EXECUTIVE) sash
	newpath
	0 0 moveto 0 700 lineto 500 700 lineto 500 0 lineto closepath
	stroke
grestore

showpage
-- 
Ben Cranston <zben@umd2.UMD.EDU>    (Kingdom of Merryland UniSys 1100/92)
Copyright 1989 (you may redistribute ONLY if your recipients can).