AMT Datasouth 400 Printer User Manual


 
User's Guide 48
Example of How to Define Label Formats
The example below shows how a label format can be defined as a PAL
TM
procedure. This label format called
Mailing_Label uses 5 variables. Notice how the variables are defined in reverse order compared to how this format is
called. This format is defined in Pal_Procs_and_Formats.txt. Looking at this file will also reveal that this procedure
makes use of the print utility procedures also defined in this file. Instead of using these print utilities, these formats
could also use direct PAL
TM
operators. This approach however allows label formats to be defined with very little
knowledge of the PAL
TM
Print and Program Language. In this label format the procedures Printfont, PrintBoldfont,
and Printbarcode are used. These are not native PAL
TM
operators but new procedures also defined in this file. Using
print utility procedures like this in the label format makes it easy to define formats using inches as the measurement
system with very little knowledge of PAL
TM
operators.
The procedure below defines a label format called Mailing_Label. This name is case sensitive. The first 5 lines after
the { character assign the passed parameters to names. These names are in turn used when needed to pass information
to PAL
TM
operators or in this case other PAL
TM
procedures. When the label format is called, the very first parameter
specified will be the name. Notice in the definition below that the Name variable is actually the last defined. This is
due to the stack based nature of PAL
TM
. The first defined parameter on the stack is the last off the stack (just like a
stack of plates for example, last one stacked is first one off). The line below shows that at an X,Y position of 0.25",
0.75", the name variable will be printed in bold at a size of 12 points with no rotation. This PrintBoldfont procedure
makes it easy to place text of any size and rotation at any position just by specifying the parameters in correct order
then calling the PrintBoldfont.
0.25 0.75 0 12 Name PrintBoldfont
If should also be noted that the label format defined below is actually just another PAL
TM
procedure definition just
like the PrintBoldfont. Parameters are passed to these procedures in the same way. The big difference is that the
PAL
TM
operator showpage is included in the label format procedure which will actually cause a label to be printed
each time this format is called.
%===============================================================================
% Mailing_Label procedure definition
% Usage: Name Street CityState Zip5 Zip4 Mailing_Label
% Example: (John Doe) (1234 Main St.) (Anytown, NC) (12345) (1234) Mailing_Label
%===============================================================================
/Mailing_Label
{
/Zip4 exch def
/Zip5 exch def
/CityState exch def
/Street exch def
/Name exch def
0.25 0.75 0 12 Name PrintBoldfont
0.25 0.55 0 12 Street Printfont
0.25 0.35 0 12 CityState ( ) concat Zip5 concat (-) concat Zip4 concat Printfont
0.1 0.1 0 0.1 Zip4 Zip5 concat /Postnet Printbarcode
showpage
} bind def