[comp.lang.postscript] Business Card programs?

roddy@snoc01.dec.com (12/12/90)

	Hi all,

	I thought I saw this a while ago but if anybody out there
	has a bit of PS for printing business cards I'd appreciate
	you sending me a copy. It's the time of year when they
	come in very handy.

	Thanks in advance and   M E R R Y  C H R I S T M A S !

				Regards,	Phil.

						roddy@snoc01.dec.enet.com

roddy@snoc01.dec.com (12/14/90)

In article <18109@shlump.nac.dec.com>, roddy@snoc01.dec.com writes...
> 
>	Hi all,
> 
>	I thought I saw this a while ago but if anybody out there
>	has a bit of PS for printing business cards I'd appreciate
>	you sending me a copy. It's the time of year when they
>	come in very handy.
> 
>	Thanks in advance and   M E R R Y  C H R I S T M A S !
> 
>				Regards,	Phil.
> 
>						roddy@snoc01.dec.enet.com

	Hi again,

	I received so many replies to the above I thought I'd
	thank you all here. Sorry for the incorrect netmail address.

	Once again - thanks and Merry Christmas.

				Regards,	Phil.

						roddy@snoc01.enet.dec.com

roddy@snoc01.dec.com (12/17/90)

In article <18140@shlump.nac.dec.com>, roddy@snoc01.dec.com writes...
> 
>In article <18109@shlump.nac.dec.com>, roddy@snoc01.dec.com writes...
>> 
>>	Hi all,
>> 
>>	I thought I saw this a while ago but if anybody out there
>>	has a bit of PS for printing business cards I'd appreciate
>>	you sending me a copy. It's the time of year when they
>>	come in very handy.
>> 
>>	Thanks in advance and   M E R R Y  C H R I S T M A S !
>> 
>>				Regards,	Phil.
>> 
>>						roddy@snoc01.dec.enet.com
> 
>	Hi again,
> 
>	I received so many replies to the above I thought I'd
>	thank you all here. Sorry for the incorrect netmail address.
> 
>	Once again - thanks and Merry Christmas.
> 
>				Regards,	Phil.
> 
>						roddy@snoc01.enet.dec.com

	Hi again,

	I received so many requests for the code, I got tired of sending
	it on an individual basis. So here's, apparently, what 'every man
	and his dog' has been waiting for ...

	The following two PS programs are a summary of what I thought to
	be the most practical and flexible cards I received. I commented
	out some of the lines and reformatted some of the info in an effort
	to tidy up the appearance. (Please excuse my personal details being
	included but it's cheap advertising on my part.)

	enjoy.

				Regards,	Phil.
						Sydney, Australia.

						roddy@snoc01.enet.dec.com

   NOTE: two programs follow ...

cut here ------8<------8<------8<------8<------8<------8<------8<------8<-----
% business_card.ps by David Paul McLure, Oct. 23, 1986
%
% cleaned-up to provide for easier editing (only need to modify the 1st section)
% made to handle any length of nick-name (up to 15 chars), Oct. 24, 1986 -dpm
%
% ideas and procedures borrowed, bastardized and modified from the following:
% 
% John Miskinis proved it could be done with a similar prototype.
% 
% digital_logo.ps by Roy Lomicka, September 13, 1985 
% (digital_logo removed before posting to net)
% 
% adapted from similar program by Brian Reid, Stanford 
% 
% refinements to better match the artwork in the DEC
% Identification Manual supplied by Scott Robinson
%
%-------------------- Edit this text --------------------
/nick_name_text 	(Bevrilla Pty Ltd)			def
/proper_name_text	(Phillip M. Roddy)			def
/job_title_text		(Software Consultant)			def
/group_name_text	(DEC Systems Specialist)		def
/sub_group_name_text	(DEC Systems, Technical/Applications)	def
/internal_mail_stop_text(SNO2-2/E4 Enet: SNOC01::RODDY)		def
/external_address_text  (Arpa: <RODDY%SNOC01.DEC@decwrl>)	def
/corp_name_text 	(BEVRILLA Pty. Ltd.)			def
/postal_address_text1 	(54 Waratah Street,) 			def
/postal_address_text2 	(EAST GOSFORD.   2250) 			def
/telephone_text 	(Tel. (043) 25-3145)			def

%-------------------- Variables --------------------
/cardwidth 	252			def
/cardheight 	144			def
/inch		{72 mul}		def
/point 		{} 			def
/cm		{2.54 72 div mul}	def
/mm		{25.4 72 div mul}	def
/degree 	{} 			def
/percent	{100 div mul}		def
/box-width 	35 34 div .405 mul 	def
/box-pitch 	box-width .85 div 	def

%-------------------- fonts --------------------
/nicknamefont
  /Times-Italic findfont 20 scalefont def
/mainfont
  /Helvetica-Bold findfont 15 scalefont def
/sloganfont
  /Helvetica-Oblique findfont 8 scalefont def
/namefont
  /Times-Bold findfont 13 scalefont def
% /Helvetica findfont 13 scalefont def

%-------------------- Procedures --------------------
/rightshow %stk:string
 {dup stringwidth pop	%get length of string
  120 exch sub	%calc. white space
  0 rmoveto	%move over that much
  show} def	%show string

/cardoutline	%print card's outline
 {newpath
  0 0 moveto
  0 144 rlineto
  252 0 rlineto
  0 -144 rlineto
  closepath
 .5 setlinewidth
  stroke} def


/doborder	%prnt card's border
 {10 10 moveto
  0 126 rlineto
  234 0 rlineto
  0 -126 rlineto
  closepath
  2 setlinewidth
  stroke} def

/center
 { dup stringwidth pop 
   cardwidth exch sub 2 div
   0 rmoveto
   dup show } def

/dotext
 {0 setgray
  namefont setfont
  0 78 moveto proper_name_text center
  sloganfont setfont
  0 69 moveto job_title_text center
  0 62 moveto group_name_text center
%  0 55 moveto sub_group_name_text center
%  0 48 moveto internal_mail_stop_text center
%  0 41 moveto external_address_text center
%  10 31 moveto corp_name_text show
  14 24 moveto postal_address_text1 show
  14 17 moveto postal_address_text2 show
  240 telephone_text stringwidth pop sub 17 moveto telephone_text show } def

%
% determine length of nickname for postioning
/nick_name_position
 { nick_name_text stringwidth pop 	% measure length of nick_name
   250 exch sub } def		% subtract from spot 245 (near right edge)

%
% optional nickname
/print_nickname  
%  {nick_name_position 100 moveto nick_name_text
  {40 102 moveto nick_name_text
  show } def

/card
 {cardoutline
  dotext
  doborder
  20 115 moveto
  gsave				% the rest is all for the optional nickname
  nicknamefont setfont
  .95 -.03 .2 		%start incr. end
    {setgray print_nickname -1 .5 translate} for
  1 setgray print_nickname 
  0 setgray 
  grestore } def

%----------------------------- Main Program --------------------

50 20 translate card			% 1st column of cards
1 1 4 {0 144 translate card} for

252 -576 translate card			% 2nd column of cards
1 1 4 {0 144 translate card} for

showpage
cut here ------8<------8<------8<------8<------8<------8<------8<------8<-----
% business_card.ps by David Paul McLure, Oct. 23, 1986
%
% cleaned-up to provide for easier editing (only need to modify the 1st section)
% made to handle any length of nick-name (up to 15 chars), Oct. 24, 1986 -dpm
%
% ideas and procedures borrowed, bastardized and modified from the following:
% 
% John Miskinis proved it could be done with a similar prototype.
% 
% digital_logo.ps by Roy Lomicka, September 13, 1985 
% (digital_logo removed before posting to net)
% 
% adapted from similar program by Brian Reid, Stanford 
% 
% refinements to better match the artwork in the DEC
% Identification Manual supplied by Scott Robinson
%
%-------------------- Edit this text --------------------
/nick_name_text 	(Bevrilla)				def
/proper_name_text	(Phillip M. Roddy)			def
/job_title_text		(Software Consultant)			def
/group_name_text	(Analysis, Design & Programming)	def
/sub_group_name_text	(DEC Systems, Technical/Applications)	def
/internal_mail_stop_text(SNO2-2/E4 Enet: SNOC01::RODDY)		def
/external_address_text  (Arpa: <RODDY%SNOC01.DEC@decwrl>)	def
/digital_corp_name_text (BEVRILLA Pty. Ltd.)			def
/postal_address_text 	(54 Waratah Street, EAST GOSFORD. 2250) def
/telephone_text 	(Tel. (043) 25-3145)			def

%-------------------- Variables --------------------
/cardwidth 	252			def
/cardheight 	144			def
/inch		{72 mul}		def
/point 		{} 			def
/cm		{2.54 72 div mul}	def
/mm		{25.4 72 div mul}	def
/degree 	{} 			def
/percent	{100 div mul}		def
/box-width 	35 34 div .405 mul 	def
/box-pitch 	box-width .85 div 	def

%-------------------- fonts --------------------
/nicknamefont
  /Times-Italic findfont 20 scalefont def
/mainfont
  /Helvetica-Bold findfont 15 scalefont def
/sloganfont
  /Helvetica-Oblique findfont 8 scalefont def
/namefont
  /Times-Bold findfont 13 scalefont def
% /Helvetica findfont 13 scalefont def

%-------------------- Procedures --------------------

/rightshow %stk:string
 {dup stringwidth pop	%get length of string
  120 exch sub	%calc. white space
  0 rmoveto	%move over that much
  show} def	%show string

/cardoutline	%print card's outline
 {newpath
  0 0 moveto
  0 144 rlineto
  252 0 rlineto
  0 -144 rlineto
  closepath
 .5 setlinewidth
  stroke} def


/doborder	%prnt card's border
 {10 10 moveto
  0 126 rlineto
  234 0 rlineto
  0 -126 rlineto
  closepath
  2 setlinewidth
  stroke} def

/center
 { dup stringwidth pop 
   cardwidth exch sub 2 div
   0 rmoveto
   dup show } def

/dotext
 {0 setgray
  namefont setfont
  0 80 moveto proper_name_text center
  sloganfont setfont
  0 71 moveto job_title_text center
  0 64 moveto group_name_text center
  0 57 moveto sub_group_name_text center
%  0 50 moveto internal_mail_stop_text center
%  0 43 moveto external_address_text center
  0 31 moveto digital_corp_name_text center
  0 24 moveto postal_address_text center
  0 17 moveto telephone_text center } def

%
% determine length of nickname for postioning
/nick_name_position
 { nick_name_text stringwidth pop 	% measure length of nick_name
   250 exch sub } def		% subtract from spot 245 (near right edge)

%
% optional nickname
/print_nickname  
  {nick_name_position 100 moveto nick_name_text
  show} def

/card
 {cardoutline
  dotext
  doborder
  20 115 moveto
  gsave				% the rest is all for the optional nickname
  nicknamefont setfont
  .95 -.03 .2 		%start incr. end
    {setgray print_nickname -1 .5 translate} for
  1 setgray print_nickname 
  0 setgray 
  grestore } def

%----------------------------- Main Program --------------------

50 20 translate card			% 1st column of cards
1 1 4 {0 144 translate card} for

252 -576 translate card			% 2nd column of cards
1 1 4 {0 144 translate card} for

showpage
cut here ------8<------8<------8<------8<------8<------8<------8<------8<-----