Selecting 'rgb' and passing three color components gives us full color, represented by 3 separate 3-decimal-place numbers, followed by the letters 'rg'. So, for example: '0.800 0.400 0.200 rg' = purple-ish color. eg. setFillColor('rgb', 0.8, 0.4, 0.2) A second, very similar function sets the drawing color: Note that the only difference between these two functions is the lowercase/uppercase syntax. 'g', 'rg', and 'k' specify fill color, while 'G', 'RG', and 'K', specify draw color. That's it! Calling either of these two functions will set the colors for any subsequent text or drawing output to your PDF document, and preserve that setting between pages.
blog comments powered by Disqus |