[comp.sys.mac] Postscript fragment needed

jonathan@eleazar.dartmouth.edu (Jonathan Altman) (04/26/89)

There was a discussion several months back about how to include
various bits of postscript in MSWord documents to do nice things
like borders around pages, etc.  One nice tip that was given was how
to print the word "draft" in a 5% gray on entire pages.  I saw the
tip on how to do this and said "that'd be neat" but didn't save the
postscript fragment.  Now I have a need to distribute a draft of a
user's manual I maintain, and I'd like the sample postscript
fragment that would do something of this sort.  If anybody has any
bits of postscript that could be included in a MSWord document to do
this, and even instructions on where to put the fragment, I'd be
most grateful to have it.  Unless there are lots of other cries of
"I'd like that also," it'd probably be better to just e-mail it to
me, but posting is o.k. if this is of general use.

Jonathan Altman           jonathan@eleazar.Dartmouth.edu
Database Administrator    (linus,harvard,decvax)!dartvax!eleazar!jonathan
Dartmouth Dante Project   voice: 603-646-2633
301 Bartlett Hall
HB 6087                   
Hanover, NH 03755

mjohnson@Apple.COM (Mark B. Johnson) (04/26/89)

In article <13222@dartvax.Dartmouth.EDU> jonathan@eleazar.dartmouth.edu (Jonathan Altman) writes:
>to print the word "draft" in a 5% gray on entire pages.  I saw the
>tip on how to do this and said "that'd be neat" but didn't save the
>postscript fragment.  Now I have a need to distribute a draft of a

This little fragment can be modified to print whatever you like.  Just
take a look at it as it is pretty simple.  If you are interested in PS,
you might also contact John Sherman at the University of Notre Dame as he
as a nice PostScript learning tool which he developed for designers and
anyone else learning PS...

% Draft marking for documents

% fonts
/t/Times-BoldItalic findfont 96 scalefont def

% 15 0 {exch pop} setscreen

150 500 translate	% position on page

.9 setgray
2 0 moveto
t setfont (Draft) show

-120 -100 moveto
t setfont (Confidential) show

Just put this into a header and make it Style PostScript...


Mark B. Johnson                                            AppleLink: mjohnson
Developer Technical Support                         domain: mjohnson@Apple.com
Apple Computer, Inc.         UUCP:  {amdahl,decwrl,sun,unisoft}!apple!mjohnson

"You gave your life to become the person you are right now.  Was it worth it?"
                                                         - Richard Bach, _One_

malis@bbn.com (Andy Malis) (04/28/89)

In article <13222@dartvax.Dartmouth.EDU> jonathan@eleazar.dartmouth.edu (Jonathan Altman) writes:
> One nice tip that was given was how
>to print the word "draft" in a 5% gray on entire pages.

Here are two fragments.  The first uses grey, the second prints
"DRAFT" using an outline font.  I personally like the second much
better. 

Andy Malis <malis@bbn.com>    UUCP: {harvard,rutgers,uunet}!bbn!malis

------- cut here -------
%! Procedure to print a light-gray DRAFT on pages
gsave
initmatrix 72 dup scale
/Helvetica-Bold findfont 1 scalefont setfont
(DRAFT) dup
stringwidth pop
4.5 5.5 translate
45 rotate 2 div neg 0 moveto
.95 setgray
show
grestore

%%  This overlay produces a 1 inch
%%  tall DRAFT at a 45 degree angle in the center of the page.
%%  The routine is self-adjusting so any string can be placed in instead
%%  of DRAFT in the above routine and used.
------- cut here -------
%!
%% outline font program 
%% Postscript Language Tutorial and Cookbook
%% page 203

/makeoutlinedict 7 dict def
/MakeOutlineFont
 {makeoutlinedict begin
  /uniqueid exch def
  /strokewidth exch def
  /newfontname exch def
  /basefontname exch def

  /basefontdict basefontname findfont def

  /numentries basefontdict maxlength 1 add def

  basefontdict /UniqueID known not
   { /numentries numentries 1 add def } if

     /outfontdict numentries dict def
  
   basefontdict
    { exch dup /FID ne
     { exch outfontdict 3 1 roll put }
     { pop pop }
    ifelse
    } forall
 
  outfontdict /FontName newfontname put
  outfontdict /PaintType 2 put
  outfontdict /StrokeWidth strokewidth put
  outfontdict /UniqueID uniqueid put
  
  newfontname outfontdict definefont pop
  end

} def

% 120 seems to give light enough lettering

/Helvetica-Bold /Helvetica-Outline1 1000 120 div

/Helvetica-Bold findfont dup /UniqueID known
 { /UniqueID get 1 add }
 { pop 1 }
 ifelse

MakeOutlineFont 

gsave
initmatrix 72 dup scale
/Helvetica-Outline1 findfont 1 scalefont setfont
(DRAFT) dup
stringwidth pop
4.5   5.5  translate
45 rotate 2 div neg 0 moveto
show
grestore

------- cut here -------

Andy Malis <malis@bbn.com>    UUCP: {harvard,rutgers,uunet}!bbn!malis

minkus@lesath.usc.edu (Bob Minkus) (05/26/89)

In article <13222@dartvax.Dartmouth.EDU> jonathan@eleazar.dartmouth.edu (Jonathan Altman) writes:
>There was a discussion several months back about how to include
>various bits of postscript in MSWord documents to do nice things
>like borders around pages, etc.  One nice tip that was given was how
>to print the word "draft" in a 5% gray on entire pages.  I saw the
>tip on how to do this and said "that'd be neat" but didn't save the
>postscript fragment.  Now I have a need to distribute a draft of a
>user's manual I maintain, and I'd like the sample postscript
>fragment that would do something of this sort.  If anybody has any
>bits of postscript that could be included in a MSWord document to do
>this, and even instructions on where to put the fragment, I'd be
>most grateful to have it.  Unless there are lots of other cries of
>"I'd like that also," it'd probably be better to just e-mail it to
>me, but posting is o.k. if this is of general use.

        "I'd like that also" :-)

        I have a postscript document that was created on a Sun system,
        using FrameMaker.  I can ftp it to a Mac SE and put it into
        MSWord.  But I can't get it to create the document on a Laserwritter.
        When I try to print it, it prints the PS code, but not the
        document itself.  Does anyone have any suggestions?

								Thanks,

								  Bob
Bob Minkus  --  USC University Computing Services
uucp: uunet!usc!minkus
bitnet: minkus@gamera
internet: minkus@usc.edu

mjohnson@Apple.COM (Mark B. Johnson) (05/26/89)

In article <17431@usc.edu> minkus@lesath.usc.edu (Bob Minkus) writes:
>In article <13222@dartvax.Dartmouth.EDU> jonathan@eleazar.dartmouth.edu (Jonathan Altman) writes:
>>various bits of postscript in MSWord documents to do nice things
>>like borders around pages, etc.  One nice tip that was given was how
>>to print the word "draft" in a 5% gray on entire pages.  I saw the
>>tip on how to do this and said "that'd be neat" but didn't save the
>>postscript fragment.  Now I have a need to distribute a draft of a

This works nicely.  Put it as the first thing in a header which appears on
on every page.  Be sure to set the style to PostScript...

% fonts
/t/Times-BoldItalic findfont 96 scalefont def

% 15 0 {exch pop} setscreen

150 500 translate	% position on page

.9 setgray
2 0 moveto
t setfont (Draft) show



Mark B. Johnson                                            AppleLink: mjohnson
Developer Technical Support                         domain: mjohnson@Apple.com
Apple Computer, Inc.         UUCP:  {amdahl,decwrl,sun,unisoft}!apple!mjohnson

"You gave your life to become the person you are right now.  Was it worth it?"
                                                         - Richard Bach, _One_

elliston@rob.UUCP ( Keith Elliston) (05/26/89)

In article <17431@usc.edu>, minkus@lesath.usc.edu (Bob Minkus) writes:
> In article <13222@dartvax.Dartmouth.EDU> jonathan@eleazar.dartmouth.edu (Jonathan Altman) writes:
> >like borders around pages, etc.  One nice tip that was given was how
> >to print the word "draft" in a 5% gray on entire pages.  I saw the
> >tip on how to do this and said "that'd be neat" but didn't save the
> >postscript fragment.  Now I have a need to distribute a draft of a
> >user's manual I maintain, and I'd like the sample postscript
> >fragment that would do something of this sort.  If anybody has any
> >bits of postscript that could be included in a MSWord document to do
> >this, and even instructions on where to put the fragment, I'd be
> 
>         "I'd like that also" :-)
> 
 I use this fragment of code (I didnt write it.... but it works...)

gsave
initmatrix 72 dup scale
/Helvetica-Bold findfont 1 scalefont setfont
(DRAFT) dup
stringwidth pop
4.5 5.5 translate
60 rotate 2 div neg 0 moveto
.95 setgray
show
grestore

You can put any characther string in the place of the word draft...(i find
that "confidential" is another good word to use...), and then put this
into the header of the document.  Make sure that you format the text as
hidden and of style Postscript (from the PS glossary).

Hope that helps....

-Keith

===============================================================================
Keith O. Elliston                        |  Usenet:  uunet!rob!elliston 
Senior Information Scientist             |  Arpanet: rob!elliston@uunet.uu.net 
Merck Sharp & Dohme Res. Lab.            |  Bitnet:  elliston%rob.uucp@psuvax1
Rahway, NJ  07065  U.S.A.                |   -or-    elliston@biovax 
===============================================================================
Disclaimer:  I can have no OFFICIAL comments about anything........
===============================================================================