🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #6661

Envelope printing program

#6661
From: Russ Nelson
Date: Mon, 30 Dec 1991 03:30
59 lines
2085 bytes
# Awk script to print envelopes from a flat file database.  It reads
# address lines from stdin, and prints them on business-sized
# envelopes (that's 4 1/8 by 9 1/2 inches, for our non-North American
# friends).  Each set of addresses is separated by a single blank
# line.  Lines begining with % in the database are ignored.  A line
# beginning with $ will prematurely terminate the database.

# They print in what would be the upper right-hand corner of a normal piece
# of paper.  If that's not where you feed envelopes into your printer, you'll
# have to change a few things.  The program expects you to manually feed the
# envelopes.

# Copyright, 1991, Crynwr Software.  Same permissions as the X Window System
# uses.

BEGIN {
	print "%!"
	print "statusdict /manualfeed true put"
	print "/in { 72 mul } def"
	newpage = 1
}

/^%/ {
	next
}

/^\$/ {
	exit
}

newpage {
	print "0 792 translate -90 rotate"
	print "/Helvetica findfont 11 scalefont setfont"
	print ".5 in 8.0 in moveto gsave (Crynwr Software) show grestore"
	print "0 -12 rmoveto gsave (11 Grant St.) show grestore"
	print "0 -12 rmoveto gsave (Potsdam NY 13676) show grestore"

	print "/Helvetica findfont 13 scalefont setfont"
	print "3.2 in 6.75 in moveto"
	newpage = 0
}

NF == 0 {
	print "showpage"
	newpage = 1
	next
}

{
	printf("gsave (%s) show grestore 0 -13 rmoveto\n", $0)
}

END {
	print "showpage"
}
--
--russ <nelson@clutx.clarkson.edu> I'm proud to be a humble Quaker.
Peace is not the absence of war.  Peace is the presence of a system for
resolving conflicts before war becomes necessary.  War never creates peace.
Technical Details
Message-ID: <NELSON.91Dec29223015@cheetah.clarkson.edu>
Path: arc1-ca.pugleaf.net!wupost!think.com!rpi!clarkson!news.clarkson.edu!nelson

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript,alt.sources
Path: arc1-ca.pugleaf.net!wupost!think.com!rpi!clarkson!news.clarkson.edu!nelson
From: nelson@sun.soe.clarkson.edu (Russ Nelson)
Subject: Envelope printing program
Message-ID: <NELSON.91Dec29223015@cheetah.clarkson.edu>
Sender: news@news.clarkson.edu
Nntp-Posting-Host: cheetah.ece.clarkson.edu
Organization: Crynwr Software, guest account at Clarkson
Date: Mon, 30 Dec 1991 03:30:15 GMT