Chapter 2. Using iText’s basic building blocks

 

This chapter covers

  • An overview of the database used in the book’s examples
  • An overview of the basic building blocks: Chunk, Phrase, Paragraph, List, ListItem, Anchor, Chapter, Section, and Image

This chapter describes a series of high-level objects that can be used as basic building blocks. These objects allow you to generate PDF documents without having to bother with PDF syntax. Figure 2.1 is a UML diagram that serves as a visual table of contents, presenting the building blocks discussed in this chapter.

Figure 2.1. UML class diagram, presenting the building blocks that will be discussed in this chapter

This class diagram is far from complete. All the methods, as well as a number of member variables, were omitted for the sake of clarity. The diagram will help you to understand in one glance how the interfaces and classes relate to each other.

We’ll discuss a first series of objects in section 2.2: Chunk, Phrase, Paragraph, and List. In section 2.3, we’ll cover a second series: Anchor, Chapter, Section, and Image. But before starting to build documents using these building blocks, let’s have a look at the database you’ll publish to different PDF files in the upcoming examples.

2.1. Illustrating the examples with a real-world database

2.2. Adding Chunk, Phrase, Paragraph, and List objects

2.3. Adding Anchor, Image, Chapter, and Section objects

sitemap