Previous Next


                                              225
      SECTION 4.4                                           Path Construction and Painting



      A path is composed of straight and curved line segments, which may connect to
      one another or may be disconnected. A pair of segments are said to connect only
      if they are defined consecutively, with the second segment starting where the first
      one ends. Thus, the order in which the segments of a path are defined is signifi-
      cant. Nonconsecutive segments that meet or intersect fortuitously are not consid-
      ered to connect.

      A path is made up of one or more disconnected subpaths, each comprising a se-
      quence of connected segments. The topology of the path is unrestricted: it may be
      concave or convex, may contain multiple subpaths representing disjoint areas,
      and may intersect itself in arbitrary ways. The h operator explicitly connects the
      end of a subpath back to its starting point; such a subpath is said to be closed. A
      subpath that has not been explicitly closed is open.

      As discussed in Section 4.1, “Graphics Objects,” a path object is defined by a se-
      quence of operators to construct the path, followed by one or more operators to
      paint the path or to use it as a clipping boundary. PDF path operators fall into
      three categories:

      • Path construction operators (Section 4.4.1) define the geometry of a path. A
        path is constructed by sequentially applying one or more of these operators.
      • Path-painting operators (Section 4.4.2) end a path object, usually causing the
        object to be painted on the current page in any of a variety of ways.
      • Clipping path operators (Section 4.4.3), invoked immediately before a path-
        painting operator, cause the path object also to be used for clipping of sub-
        sequent graphics objects.


4.4.1 Path Construction Operators

      A page description begins with an empty path and builds up its definition by in-
      voking one or more path construction operators to add segments to it. The path
      construction operators may be invoked in any sequence, but the first one invoked
      must be m or re to begin a new subpath. The path definition concludes with the
      application of a path-painting operator such as S, f, or b (see Section 4.4.2, “Path-
      Painting Operators”); this operator may optionally be preceded by one of the
      clipping path operators W or W* (Section 4.4.3, “Clipping Path Operators”). Note
      that the path construction operators do not place any marks on the page; only the
      painting operators do that. A path definition is not complete until a path-painting
      operator has been applied to it.

Previous Next