Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

5. Graphics > Building and Painting Paths

Building and Painting Paths

We’re using a landscape US Letter page (width 11 inches or 792 points; height 8.5 inches or 612 pts). The PDF coordinate system, by default, has the origin at the lower-left corner of the page, with x and y increasing rightward and upward, respectively.

Let’s use some path construction, stroking, and line attribute operators to build a simple graphics stream:

100 100 m 300 200 l 700 100 l Move to (100, 100), line to (300, 200), line to (700, 100)
S Stroke the line
8 w Change line width from the default (1.0) to 8.0
1 J Change line ending cap to rounded (code 1) from default square (code 0)
100 200 m 300 300 l 700 200 l Define new path, same shape but 100pts higher up the page
S Stroke the new line
[20] 0 d Change to 20pt dashes
100 300 m 300 400 l 700 300 l Define new path, same shape but another 100pts higher up the page
S Stroke the new line

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint