From:	SMTP%"RELAY-INFO-VAX@CRVAX.SRI.COM"  6-JUN-1994 09:38:07.08
To:	EVERHART
CC:	
Subj:	Re: Barcode Code 39 generation in Postscript format

From: loreti@fnalv.fnal.gov (Maurizio Loreti)
X-Newsgroups: comp.os.vms
Subject: Re: Barcode Code 39 generation in Postscript format
Date: 2 Jun 94 07:53:48 -0600
Organization: Fermi National Accelerator Lab
Lines: 206
Message-Id: <1994Jun2.075348.1@fnalv.fnal.gov>
Nntp-Posting-Host: fnalf.fnal.gov
To: Info-VAX@CRVAX.SRI.COM
X-Gateway-Source-Info: USENET

In article <01HD2AWFTB0Y8ZDYSJ@usthk.ust.hk>, "Wayne Yung, CCST HKUST, Tel:358-6228, Fax:358-2034" writes:
> 
> We have developed an inventory system which will read the barcode in code 39
> format directly from a barcode scanner.  In our environment, we are using the
> POSTSCRIPT printer as our hardcopy output device.   In the furture, we will 
> design a subsystem which will generate the barcodes as part of the reports.
> Does anyone of you can send me information about the generation of the barcode
> code 39 in the POSTSCRIPT form ?  It is appreciated if you can send me the code
> of the generation as well.
>  
> Thanks for any help!
>  
> Wayne
> ccwayne@usthk.ust.hk

This has appeared in comp.lang.postscript some time ago...  enjoy!

Maurizio Loreti
Un. of Padova, Dept. of Physics -- Padova, Italy
--------------------
%!PS-Adobe-2.0
%%Title: barcode.ps
%%Creator: Willem van Schaik
%%CreationDate: aug 1992
%%Pages: 1
%%DocumentFonts: Helvetica Code39
%%BoundingBox: 0 0 595 842
%%EndComments

/newfont 10 dict def
newfont begin
/FontType 3 def
/FontMatrix [0.01 0 0 0.01 0 0] def
/FontBBox [0 0 100 100] def

/Encoding 256 array def
0 1 255 {Encoding exch /.notdef put} for
Encoding 32 /barSpace put
Encoding 36 /barDollar put
Encoding 37 /barPercent put
Encoding 42 /barAsterisk put
Encoding 43 /barPlus put
Encoding 45 /barHyphen put
Encoding 46 /barPeriod put
Encoding 47 /barSlash put
Encoding 48 /bar0 put
Encoding 49 /bar1 put
Encoding 50 /bar2 put
Encoding 51 /bar3 put
Encoding 52 /bar4 put
Encoding 53 /bar5 put
Encoding 54 /bar6 put
Encoding 55 /bar7 put
Encoding 56 /bar8 put
Encoding 57 /bar9 put
Encoding 65 /barA put
Encoding 66 /barB put
Encoding 67 /barC put
Encoding 68 /barD put
Encoding 69 /barE put
Encoding 70 /barF put
Encoding 71 /barG put
Encoding 72 /barH put
Encoding 73 /barI put
Encoding 74 /barJ put
Encoding 75 /barK put
Encoding 76 /barL put
Encoding 77 /barM put
Encoding 78 /barN put
Encoding 79 /barO put
Encoding 80 /barP put
Encoding 81 /barQ put
Encoding 82 /barR put
Encoding 83 /barS put
Encoding 84 /barT put
Encoding 85 /barU put
Encoding 86 /barV put
Encoding 87 /barW put
Encoding 88 /barX put
Encoding 89 /barY put
Encoding 90 /barZ put

/CharProcs 45 dict def
CharProcs begin
/.notdef {} def
/barSpace {0 7 17 17 7 7 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barDollar {0 7 17 7 17 7 17 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barPercent {0 7 7 7 17 7 17 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barAsterisk {0 7 17 7 7 17 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barPlus {0 7 17 7 7 7 17 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barHyphen {0 7 17 7 7 7 7 17 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barPeriod {0 17 17 7 7 7 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barSlash {0 7 17 7 17 7 7 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar0 {0 7 7 7 17 17 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar1 {0 17 7 7 17 7 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar2 {0 7 7 17 17 7 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar3 {0 17 7 17 17 7 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar4 {0 7 7 7 17 17 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar5 {0 17 7 7 17 17 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar6 {0 7 7 17 17 17 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar7 {0 7 7 7 17 7 7 17 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar8 {0 17 7 7 17 7 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar9 {0 7 7 17 17 7 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barA {0 17 7 7 7 7 17 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barB {0 7 7 17 7 7 17 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barC {0 17 7 17 7 7 17 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barD {0 7 7 7 7 17 17 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barE {0 17 7 7 7 17 17 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barF {0 7 7 17 7 17 17 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barG {0 7 7 7 7 7 17 17 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barH {0 17 7 7 7 7 17 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barI {0 7 7 17 7 7 17 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barJ {0 7 7 7 7 17 17 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barK {0 17 7 7 7 7 7 7 17 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barL {0 7 7 17 7 7 7 7 17 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barM {0 17 7 17 7 7 7 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barN {0 7 7 7 7 17 7 7 17 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barO {0 17 7 7 7 17 7 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barP {0 7 7 17 7 17 7 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barQ {0 7 7 7 7 7 7 17 17 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barR {0 17 7 7 7 7 7 17 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barS {0 7 7 17 7 7 7 17 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barT {0 7 7 7 7 17 7 17 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barU {0 17 17 7 7 7 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barV {0 7 17 17 7 7 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barW {0 17 17 17 7 7 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barX {0 7 17 7 7 17 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barY {0 17 17 7 7 17 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barZ {0 7 17 17 7 17 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
end

/BuildChar
{ 100 0 0 0 93 100 setcachedevice
  exch
  begin
    Encoding exch get
    CharProcs exch get
    end
  exec
} def
end

/Code39 newfont definefont pop

%%EndProlog

%%Page: - 1
%%PageFonts:

72 25.4 div dup scale

/Code39 findfont [5 0 0 15 0 0] makefont setfont
20 240 moveto (*CODE-39 BARCODES*) show
20 220 moveto (*WILLEM VAN SCHAIK*) show

/Helvetica findfont 3 scalefont setfont
150 240 moveto (CODE-39 BARCODES) show
150 220 moveto (WILLEM VAN SCHAIK) show

showpage

%%Trailer

