beautypg.com

Execform – AMT Datasouth PAL User Manual

Page 101

background image

95

execform

After PAL captures the drawing sequences and has created the form, PAL saves the form image
inside FormDict. Whenever PAL executes the execform operator, it checks the specified
FormDict to see if the dictionary already contains a previously created form. If the dictionary
already contains a form, PAL does not bother to execute the drawing sequences. Instead, PAL
simply renders the already created form onto the page.

The execform operator provides the user with the capability of drawing repetative images only a
single time. These images can then be rendered multiple times onto a single or multiple pages
without having to repeat the drawing operations. This has the affect of improving print speed since
the printer does not have to perform redundant drawing operations.

Although the execform operator has several complex parameters, the operator can be easy to use
if a couple simple models are followed. First, in all cases, the /FormType entry always has the
value one (1). Therefore, every FormDict must contain the entry "/FormType 1". Other values
have been reserved for future options.

Second, most users do not wish to alter the current transformation matrix when drawing their form.
Most users wish to draw their form using the same coordinate system in which they are drawing the
rest of their page. As a result, FormDict typically contains the entry "/Matrix [1 0 0 1 0 0]". This
entry specifies that the current transformation matrix will not be altered for the drawing operations.

The /BBox entry in FormDict specifies the area on the page in which the form image is to be
drawn. The first time execform is executed, PAL will capture all drawing operations which occur
to that area of the page. It will then save the image of that area as the form image within FormDict.
If FormDict already contains a previous form image when execform is executed, PAL will then
draw the existing image onto the page within the specified /BBox area.

The /PaintProc entry in FormDict specifies the actual procedure which performs the drawing
operations to be captured within the form image. The entry has an actual procedure, and not just
the name of a defined procedure. Therefore, the entry has the appearance "/PaintProc {...drawing
operations...
}". However, for more complex drawing operations, it is common for the /PaintProc
procedure simply to execute a separately defined procedure. For example, the entry might simply
be "/PaintProc {MyFormDrawProc}", where MyFormDrawProc is the name of a previously
defined procedure.

Since PAL saves the form image within FormDict, the user should treat FormDict as if it were the
actual form image. So long as the user keeps FormDict saved in memory, any form image
contained in FormDict will also remain saved. Once the user discards FormDict from memory, the
form image will be lost and will need to be regenerated if it is required in the future.

Since form images can consume considerable memory depending upon their size, users should
consider explicity discarding any FormDicts from memory when changing between different types
of pages to be printed. This will release the memory being used for form images which do not
apply to the new pages.

The following shows a template for one way to use the execform operator. In the template, the
user simply needs to replace the italicized portions with the information appropriate for the form to
be rendered.