Lexmark imagequick User Guide

Page of 34
14
Supported image formats
The following example demonstrates how to add an annotation to all 
pages within a job.  It requires that PostScript setup code be 
prepended to the job, and cleanup code be appended to the job. In 
the following example, imagesetclip increases the upper and lower 
margins by 50 units. Imageshowpage prints a message with a border 
at the bottom and top of the page. Since the clippath was reduced, an 
initgraphics is done to allow drawing into the previously protected 
area.
Setup code to prepend to the job:
%!
true 0 startjob
/imagesetclip {10 dict begin clippath pathbbox /ury 
exch def /urx exch def /lly exch def /llx exch def /lly 
lly 50 add def /ury ury 50 sub def
llx lly urx llx sub ury lly sub rectclip end}def
/imageshowpage {
10 dict begin
% Print lower message
initgraphics clippath pathbbox pop pop 10 add exch 10 
add exch translate
/Helvetica 20 selectfont newpath 0 0 moveto (Business 
use only bottom message)
dup false charpath pathbbox
/ury exch def /urx exch def /lly exch def /llx exch def
% draw a box around the message
llx 5 sub lly 5 sub urx llx sub 10 add ury lly sub 10 
add 2 setlinewidth rectstroke
newpath 0 0 moveto show
% Print upper message
initgraphics clippath pathbbox 32 sub 3 index 10 add 
exch translate pop pop pop
/Helvetica 20 selectfont newpath 0 0 moveto (Business 
use only upper message)
dup false charpath pathbbox
/ury exch def /urx exch def /lly exch def /llx exch def
% draw a box around the message
llx 5 sub lly 5 sub urx llx sub 10 add ury lly sub 10 
add 2 setlinewidth rectstroke
newpath 0 0 moveto show
showpage end}def