Re: Putting a logo in the background of a text page

Subject: Re: Putting a logo in the background of a text page
From: Chris Goolsby <goolsby -at- DG-RTP -dot- DG -dot- COM>
Date: Mon, 4 Jul 1994 09:49:38 -0400


> Date: Sun, 3 Jul 1994 23:15:10 -0400
> From: "Contr Karl E. Vogel" <vogelke -at- C-17IGP -dot- WPAFB -dot- AF -dot- MIL>
> Subject: Putting a logo in the background of a text page

> >> On Thu, 30 Jun 1994 16:37:21 GMT,
> >> Caryn Rizell <caryn -at- hpptc95 -dot- rose -dot- hp -dot- com> said:

> Caryn> Is it possible to put something (like a logo) in the background on a
> Caryn> text page? For example, sometimes I have seen the word 'draft' show
> Caryn> up behind the text, but the text still displays.

> Here's some PostScript code which puts the word "DRAFT" diagonally
> across a page in light grey letters. We insert it right after each
> pagebreak in a generated PostScript file when we need a draft copy of
> something. (I know, the whole world's not PostScript... :)

> %-----START POSTSCRIPT DRAFT PAGE-----
> gsave

> /font /Helvetica-Bold def
> /pointsize 72 def
> /text (DRAFT) def

> /center {dup stringwidth pop
> 2 div neg 0 rmoveto} def
> 306 396 moveto
> .8 setgray
> font findfont pointsize scalefont setfont
> 45 rotate
> 24 0 text center ashow
> grestore
> %-----END POSTSCRIPT DRAFT PAGE-----

> --
> Karl Vogel vogelke -at- c-17igp -dot- wpafb -dot- af -dot- mil [134.136.19.253]


Similarly, here's a UNIX script we use that puts a word across every
page in a PostScript file. The word is placed diagonally across the
page in outline letters, not gray. The default word is "DRAFT," but
you can pass it about any word. I've used "BETA," "FINAL," etc. as
the situation required. The format of the command is:

psdraft [-s draftstring] file.ps

-------Begin-Script------------------------------------------------

#! /bin/sh

# Put the word "DRAFT" (or a specified word) on each page of a postscript
# document.

# Usage:
# psdraft -s draftstring file ...


# Author: Spencer W. Thomas
# Computer Science Dept.
# University of Utah
# thomas -at- cs -dot- utah -dot- edu


# Insert header after first line that does not begin %% or %!


trap "rm -f /tmp/psd$$.*" 0 1 2 15

if [ "x$1" = "x-s" ] ; then
draftstring=$2
shift
shift
else
draftstring=DRAFT
fi

if [ "x$*" = "x" ] ; then
echo "Usage: psdraft [-s draftstring] files ..."
exit
fi

# Create sed script file

sed "s/(DRAFT)/($draftstring)/" <<'EOF' >/tmp/psd$$.sed
1,/^[^%]/{
s/^%/%/
s/^$//
t skip
i\
% Prelude to show a draft string on every page.\
(DRAFT)\
/DRAFTDICT 10 dict def\
DRAFTDICT begin\
/DRAFTSTRING exch def\
/bd /Helvetica-Bold findfont def\
/od bd maxlength 1 add dict def\
bd {exch dup /FID ne {exch od 3 1 roll put} {pop pop} ifelse} forall\
od /FontName /Outline0 put od /PaintType 2 put od /StrokeWidth 0 put\
/Outline0 od definefont pop\
/DRAFT { gsave\
initmatrix\
/Outline0 findfont setfont\
DRAFTSTRING dup stringwidth pop 8.875 exch div dup 72 mul dup scale\
52.3 rotate 2.5 exch div -.35 translate\
0 0 moveto show\
grestore } def\
/oldshow /showpage load def\
/oldcopy /copypage load def\
end\
/showpage { DRAFTDICT begin DRAFT oldshow end } def\
/copypage { DRAFTDICT begin DRAFT oldcopy end } def\
% End of draft prelude
: skip

EOF

cat $* | sed -f /tmp/psd$$.sed

----------End-Script-------------------------------------------


Previous by Author: Re: Software Packages
Next by Author: Re: Abbr. for kilobyte?
Previous by Thread: Putting a logo in the background of a text page
Next by Thread: Re: Putting a logo in the background of a text page


What this post helpful? Share it with friends and colleagues:


Sponsored Ads