Previous Next


                                                      226
            CHAPTER 4                                                                        Graphics



            The path currently under construction is called the current path. In PDF (unlike
            PostScript), the current path is not part of the graphics state and is not saved and
            restored along with the other graphics state parameters. PDF paths are strictly in-
            ternal objects with no explicit representation. Once a path has been painted, it is
            no longer defined; there is then no current path until a new one is begun with the
            m or re operator.

            The trailing endpoint of the segment most recently added to the current path is
            referred to as the current point. If the current path is empty, the current point is
            undefined. Most operators that add a segment to the current path start at the cur-
            rent point; if the current point is undefined, an error is generated.

            Table 4.9 shows the path construction operators. All operands are numbers de-
            noting coordinates in user space.

                                     TABLE 4.9 Path construction operators
OPERANDS               OPERATOR             DESCRIPTION

x y                    m                    Begin a new subpath by moving the current point to coordinates
                                            (x, y), omitting any connecting line segment. If the previous path
                                            construction operator in the current path was also m, the new m
                                            overrides it; no vestige of the previous m operation remains in the
                                            path.

x y                    l (lowercase L)      Append a straight line segment from the current point to the point
                                            (x, y). The new current point is (x, y).

x 1 y1 x2 y2 x 3 y 3   c                    Append a cubic Bézier curve to the current path. The curve extends
                                            from the current point to the point (x3 , y3 ), using (x1 , y1 ) and
                                            (x2 , y2 ) as the Bézier control points (see “Cubic Bézier Curves,” be-
                                            low). The new current point is (x3 , y3 ).

x 2 y2 x3 y3           v                    Append a cubic Bézier curve to the current path. The curve extends
                                            from the current point to the point (x3 , y3 ), using the current point
                                            and (x2 , y2 ) as the Bézier control points (see “Cubic Bézier Curves,”
                                            below). The new current point is (x3 , y3 ).

x 1 y1 x3 y3           y                    Append a cubic Bézier curve to the current path. The curve extends
                                            from the current point to the point (x3 , y3 ), using (x1 , y1 ) and
                                            (x3 , y3 ) as the Bézier control points (see “Cubic Bézier Curves,” be-
                                            low). The new current point is (x3 , y3 ).

Previous Next