concept number in category itext

This is an excerpt from Manning's book iText in Action, Second Edition.
The content needs to be customized or personalized; for instance, the name of the end user has to be stamped on a number of pages.
In figure 5.1, you list a number of screenings and include the run length of each movie. Suppose you wanted to add visual information that is identical to the textual info, but that can be read in a glance. This is done in figure 5.2: by looking at the background of the cell with the duration, you immediately get an indication of the run length of the movie.
In listing 5.8, you’ll also find a countYear() method. This method is invoked because you’re setting the year as a generic tag for the movie titles. A list of these years and the number of times each year occurs is kept in the member variable years. Here is what you can do with this TreeMap.
Listing 5.10. MovieYears.java (continued)
document.newPage(); writer.setPageEvent(null); for (Map.Entry entry : event.years.entrySet()) { p = new Paragraph(String.format("%s: %d movie(s)", entry.getKey(), entry.getValue())); document.add(p); }You start a new page and remove the page events from the writer by setting the page events to null. You don’t want any of the page events to be active, and figure 5.5 shows that GenericTags wasn’t the only event used in this example—you also used a Paragraph event to draw extra lines. You don’t want these lines to appear when you create an overview of the years for which you have a film in the database, along with the number of times each year occurs. This overview is shown in figure 5.6.