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... :)

> 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

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

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]


#! /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

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

# Create sed script file

sed "s/(DRAFT)/($draftstring)/" <<'EOF' >/tmp/psd$$.sed
t skip
% Prelude to show a draft string on every page.\
/DRAFTDICT 10 dict def\
/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\
/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\
/showpage { DRAFTDICT begin DRAFT oldshow end } def\
/copypage { DRAFTDICT begin DRAFT oldcopy end } def\
% End of draft prelude
: skip


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


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