My work, my ideas, my faith, my life

My Postscript Mentor Business Card

By Rex Goode

In addition to software engineering, I mentor developmentally disabled adults in life skills. I teach various sills related to community living and being included in community activities. I developed a business card to give to agencies and clients that outlined some of the things I teach.

I used the Postscript® language developed by Adobe Systems Incorporated. This language was originally developed to power printers, but is now available for computers systems via the Ghostscript interpreter. Ghostscript takes Postscript® instructions, interprets them, and then renders them for the creation of a bitmap that can be saved as a file. Ghostview and GSview are programs that can show these bitmaps and then convert them to other formats.

Ghostscript, Ghostview (for UNIX or Linux), and GSview (for PCs) are all downloadable for free, although a registration fee is always appreciated. I also downloaded the Adobe Reader® so I could print my cards from it. It allowed more flexibility that the GSview program.

After I got Ghostscript and GSview downloaded to my PC, I created my program below. I borrowed from the Postscript© blue blook, more accurately known as Postscript Language Tutorial and Cookbook. It has a program that lets you take a regular font and turn it into an outline font. You can view this book online. Here’s the program with comments.


%%Title: Blue Book Program 16, on page 203
%%Creator: Adobe Systems Incorporated
%%CreationDate: Fri Dec 29 12:39:20 PST 1989
%%EndComments
/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
/NewCenturySchlbk-BoldItalic
     /NewCenturySchlbk-BoldItalic-Outline1 1000 54 div
  /NewCenturySchlbk-BoldItalic findfont dup /UniqueID known
    { /UniqueID get 1 add }
    { pop 1 }
    ifelse
  MakeOutlineFont
% 72 pixels per inch. I like to do things in terms of inches
/inch { 72 mul } def
/pagebottom .45 inch def % bottom of the bottom row of cards
/pageleft .8 inch def  % left of the left column of cards
/cardheight 2 inch def  % height of one card
/papertop 11 inch def  % top of the physical paper
/paperright 8.5 inch def % right of the physical paper
/printtop 10.4 inch def  % top of the top row of cards
/printright 7.7 inch def % the right of the right column of cards
/cardright 7.5 inch def  % the printable limit of the 
                         % right of the right column of cards
/cardwidth 3.45 inch def % the width of one card
/paperhalf 4.25 inch def % midpoint of the physical paper
/xoffset 14 def   % how far from the right edge of the card
                  % I want any printing to start
/yoffset 10 def % how far from the bottom of the edge
                % of the card I want any printing to start
/rot 20 def % how many degrees I want the name to rotate
/myname (Rex Goode, BSW) def % my name on the card
%%
%% The following 4 lines of code
%% should be commented out for printing
%%
% draws a guide line on the left side of the card page
pageleft   0 moveto pageleft   papertop lineto stroke
% draws a guide line on the right side of the card page
printright 0 moveto printright papertop lineto stroke
% draws a guide line up the center of the page
paperhalf  0 moveto paperhalf  papertop lineto stroke
% draws a guide line at the top of the top row of cards
0 printtop 4 add moveto paperright printtop 4 add lineto stroke
/fsize 14 def  % the font size for my name
/bulletitem {  % procedure to place an item followed by a bullet
 /bull exch def
 /bully exch def
 /bullx exch def
 /Helvetica findfont 10 scalefont setfont
 bullx bully moveto bull show currentpoint exch 2 add exch moveto
 /ZapfDingbats findfont 10 scalefont setfont
 (F) show
 currentpoint exch 2 add exch  % leaves the current end
                               % of the bullet position (+2)
                               % on the stack
 /Helvetica findfont 10 scalefont setfont
} def
pagebottom cardheight printtop {  % loop from bottom to top
 /y exch def    % the bottom edge of the current card
 pageleft cardwidth cardright {  % loop from left to right
  /x exch def   % the left edge of the current card
  % draws a guide line around the card (uncomment for printing)
  0 y moveto x paperright y lineto stroke
  /NewCenturySchlbk-BoldItalic findfont fsize scalefont setfont
  gsave
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %%%%%%%%% everything in this loop draws one card %%%%%%%%%
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   x xoffset add y yoffset add translate
   gsave
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %%%%% everything in this subsection shows %%%%%
    %%%%% my name as if it is taking off from %%%%%
    %%%%% the page                            %%%%%
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1 1.3 scale
    rot rotate
    /blue .6 def
    .9 .9 1 setrgbcolor
    /diswidth myname stringwidth pop 10 add def
%     the following two lines show a background where
%     the name will land (uncomment for printing)
%    0 -8 moveto 0 32 lineto diswidth 32 lineto
%    diswidth -10 lineto 0 -10 lineto fill
    0 .5 20 {
     .5 blue 1 setrgbcolor
     /lastx -4 blue 8 mul add def
     /lasty 24 blue 8 mul add def
     lastx lasty moveto
     myname show
     /NewCenturySchlbk-BoldItalic-Outline1 
           findfont fsize scalefont setfont
     /blue blue .06 add def
    } for
    /NewCenturySchlbk-BoldItalic-Outline1 
           findfont fsize scalefont setfont
    0 0 0 setrgbcolor
    lastx lasty moveto myname show
   grestore
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %%%%% title of the card %%%%%
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   /Charter-Bold findfont 12 scalefont setfont
   -6 108 moveto (Mentor) show
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %%%%% contact information %%%%%
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   /Times-Roman findfont 10 scalefont setfont
   -8 20 moveto (18641 S.E. Clinton St.) show
   -8 10 moveto (Gresham, OR   97030) show
   -8  0 moveto (503 267-2840) show
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %%%%% skill categories %%%%%
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%
   /Helvetica-Bold findfont 10 scalefont setfont
   132 120 moveto (Community Living) show
   124 108 moveto (Community Inclusion) show
   %%%%%%%%%%%%%%%%%%%%%%%%%
   %%%%% skill details %%%%%
   %%%%%%%%%%%%%%%%%%%%%%%%%
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   % The bulletitem procedure sets the text sent to it and then %
   % adds a bullet at the end. It leaves the x+2,y position of  %
   % the bullet on the stack. If you want to end the line,      %
   % there, you have to pop these two coordinates before moving %
   % down to the next line. If you want add a word to the end   %
   % of the line without a bullet, do a "moveto" right after    %
   % you call bulletitem and the a (text) show.                 %
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   114 086 (Exercise) bulletitem moveto (Personal) show
   110 076 (Hygiene) bulletitem (Laundry) bulletitem pop pop
   108 066 (Housing) bulletitem (Shopping) bulletitem pop pop
   104 056 (Medical Appointments) bulletitem pop pop
   100 046 (Legal Obligations) bulletitem moveto (Anger) show
   096 036 (Management) bulletitem (Mediation) bulletitem pop pop
   092 026 (Communication) bulletitem (Budgeting) bulletitem
   088 016 (Boundaries) bulletitem moveto (Chemical) show
   088 006 (Dependency) bulletitem 
           (Transportation) bulletitem pop pop
   /Helvetica-Bold findfont 12 scalefont setfont
   140 -06 moveto (Life!) show
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %%%%%%%%%%%%%%%%%%%%% end of one card %%%%%%%%%%%%%%%%%%%%
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  grestore
  0 0 0 setrgbcolor
 } for
} for
showpage

Here is the end product:

Business Card

Business Card

The program is fairly simple. Postscript® is different than a lot of languages you see that seem more like English. In other computer languages, you issue a command followed by the arguments, like echo “Hello, World”; in PHP would print “Hello, World” to the screen. In Postscript® it is backwards. You would do (Hello, World) show in Postscript®. Since this isn’t a tutorial on programming in this language, I’ll leave the details out. I recommend the tuturial mentioned above.

I saved the above code as mentorcards.ps on my system. Then, I ran the GSview interpreter and opened mentorcards.ps with it. My cards appeared. I tweaked the program above in my text editor and then refreshed it in GSview until it looked just like I wanted it. Once it was ready, I commented out the lines of code in my program that printed guide lines.

The GSview File editor has a Convert option. I used that to convert my program into a PDF file for use with Adobe Reader®. Then, with Adobe reader and my Avery® brand cardstock 8376™ cards, I printed my cards.

I won’t mind if you copy my program and tweak it for your own use. If you can’t find the same cards as I did, you can adjust the numbers near the top of the program to match. If you have any trouble with it, leave a comment here and I’ll be glad to help you.

1 person likes this post.

One Response to “My Postscript Mentor Business Card”

  1. ok said:

    good site daouxw

Leave a Reply

If your comment is a support question, please post it at the forums.