Previous Next


                                       356
CHAPTER 4                                                                 Graphics



Form XObjects have various uses:

• As its name suggests, a form XObject can serve as the template for an entire
  page. For example, a program that prints filled-in tax forms can first paint the
  fixed template as a form XObject and then paint the variable information on
  top of it.
• Any graphical element that is to be used repeatedly, such as a company logo or
  a standard component in the output from a computer-aided design system, can
  be defined as a form XObject.
• Certain document elements that are not part of a page’s contents, such as
  annotation appearances (see Section 8.4.4, “Appearance Streams”), are repre-
  sented as form XObjects.
• A specialized type of form XObject, called a group XObject (PDF 1.4), can be
  used to group graphical elements together as a unit for various purposes (see
  Section 4.9.2, “Group XObjects”). In particular, group XObjects are used to de-
  fine transparency groups and soft masks for use in the transparent imaging
  model (see “Soft-Mask Dictionaries” on page 552 and Section 7.5.5, “Transpar-
  ency Group XObjects”).
• Another specialized type of form XObject, a reference XObject (PDF 1.4), can
  be used to import content from one PDF document into another (see Section
  4.9.3, “Reference XObjects”).

The use of form XObjects requires two steps:

1. Define the appearance of the form XObject. A form XObject is a PDF content
   stream. The dictionary portion of the stream (called the form dictionary)
   contains descriptive information about the form XObject; the body of the
   stream describes the graphics objects that produce its appearance. The con-
   tents of the form dictionary are described in Section 4.9.1, “Form Diction-
   aries.”
2. Paint the form XObject. The Do operator (see Section 4.7, “External Objects”)
   paints a form XObject whose name is supplied as an operand. (The name is
   defined in the XObject subdictionary of the current resource dictionary.)
   Before invoking this operator, the content stream in which it appears should
   set appropriate parameters in the graphics state. In particular, it should alter
   the current transformation matrix to control the position, size, and orientation
   of the form XObject in user space.

Previous Next