concept shape in category itext

This is an excerpt from Manning's book iText in Action, Second Edition.
Steps
,
, and
are the same as they were in listing 1.1, but you need to make a small change to step
. Instead of using an unnamed instance of PdfWriter, you now give it a name: writer. You need this instance because you want to grab a canvas on which you can draw lines and shapes, and, in this case, text. In listing 1.11, comment sections were added, reflecting the PDF syntax that is written by each method.
The first series of operators we’ll look at can be used to construct paths that will be used to stroke lines and to fill shapes.
Table 14.4 lists the convenience methods that were used to draw the final row of shapes shown in figure 14.2. These shapes can’t be drawn using a single operator in PDF. The path is constructed using different subpaths as was done for the circle in listing 14.2.
Table 14.4. iText convenience methods for graphics
iText method
Parameters
Description
arc (x1, y1, x2, y2, startAng, extent) Constructs the path of a partial ellipse inscribed within the rectangle [x1 y1 x2 y2], starting at startAng degrees and covering extent degrees. Angles start with 0 to the right and increase counterclockwise. ellipse (x1, y1, x2, y2) Constructs the path of an ellipse using the arc method, starting at 0 degrees and covering 360 degrees. circle (x, y, r) Constructs the path of a circle with center (x,y) and radius r using one moveTo() and four curveTo() instructions. roundRectangle (x, y, w, h, r) Constructs the path of a rounded rectangle. rectangle (rect) Draws a Rectangle object. Constructs the path, fills it with the background color of rect (if any) and strokes the borders. The first four methods in this table construct the path, but don’t draw it; this is similar to what the rectangle() method in table 14.2 does. If you want to see the shapes, you need to stroke() or fill() the paths, or both. The rectangle() method in table 14.4 calls these methods implicitly, because there are different colors and line widths involved.
To draw lines and shapes using different stroke and fill properties, you’ll need to change the graphics state.
,
, and
are the same as they were in
. Instead of using an unnamed instance of PdfWriter, you now give it a name: writer. You need this instance because you want to grab a canvas on which you can draw lines and shapes, and, in this case, text. In