Chapter 11. Adding color and text

This chapter covers

  • PDF and Color spaces

  • Transparency and clipping

  • PDF’s text state

We already dealt with a great deal of the theory described in chapter 4 of the PDF Reference (”Graphics”). We’ll continue by discussing colors and colorspaces. Each object in PDF can be in 11 different colorspaces, but you don’t have to worry about that; iText provides color classes that hide the complex theory.

While we’re talking about color, we’ll also discuss rendering (chapter 6 of the PDF Reference) and transparency (chapter 7). You’ll also learn how to apply masks to an image.

We’ll complete this chapter by explaining how text state is implemented in iText. This will let you add street names to the map of Foobar.

Adding color to ...

Get iText in Action: Creating and Manipulating PDF now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.