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 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.