Chapter 14. The imaging model
This chapter covers
- The PDF imaging model
- All methods in PdfContentByte
- Using Graphics2D to create PDF content
We studied the Carousel Object System in the previous chapter. We used iText to find, remove, change, and replace objects in a PDF file. In this chapter, we’ll look at one specific type of object: the stream containing the syntax that makes up a page.
First we’ll look at the PDF imaging model and learn how to draw graphics and text using PDF syntax. Then we’ll look at the Java class java.awt.Graphics2D as an alternative solution for achieving the same results. In both cases, we’ll add content at absolute positions as we did in chapter 3. Chapter 3 explained the mechanisms available in iText, but this chapter dives straight into the PDF syntax.
This chapter includes different tables listing all the possible graphics and text operators and operands. This chapter will serve as a reference that can be used to look up the meaning of the syntax in a PDF file, and to find the iText methods that correspond with this syntax.