Stephen Kitt holds a Bachelor's degree in Artificial Intelligence and Computer Science. He has been developing in Java since 1996, in Scotland and France. In 2001 he joined Cosmosbay~Vectis, where he develops and manages J2EE-based projects.
| Author(s) | Bruno Lowagie |
|---|---|
| Publisher | Manning |
| PubDate | December 2006 |
| Reviewer: | Stephen Kitt |
iText is a Java-based document-creation library, capable of outputting HTML, RTF and PDF documents. (It has also been ported to .NET.) Its main intent is the production and manipulation of PDF files; it can produce pretty much any static PDF you can imagine, and it supports many PDF form features too. This book aims to describe iText's philosophy and describe its functionality; as such, its main audience is developers using iText, but developers and managers evaluating iText will also be interested, as will anyone interested in the finer points of PDF production.
I've been using iText for over a year, but I still learnt an awful lot while reading this book. The author, Bruno Lowagie, created iText and knows what he's talking about, and this shows throughout the book; in particular, the reader benefits from Lowagie's knowledge of the project's history and his experience using the library.
Chapter 1: iText, when and why - describes iText's history, and introduces the scenario which underlies many of the book's examples; this also serves as a showcase of iText's capabilities, and can help the reader explain what iText is capable of.
Chapter 2: PDF engine jump-start - a whirlwind tour of iText's basic PDF production features, and most of its manipulation features; this sets the hectic pace in force throughout most of the book, covering many concepts and providing over thirty examples!
Chapter 3: PDF, why and when - describes the Portable Document Format's history, the features provided by the different versions, and iText's support thereof.
Chapter 4: Composing text elements - introduces iText's high-level text composition (paragraphs, lists, links...); also serves as a reference for the Chunk object.
Chapter 5: Inserting images - covers basic image functionality: inserting and transforming images; covers loading images in various formats from various sources, scaling, rotating, masking and decorating them, and placing them on the page, either on their own or with text, as a background or wrapped...
Chapter 6: Constructing tables - describes iText's extensive PDF-specific table support, including cell decorations, handling cells and tables which don't fit on a single page, column and row spanning, overflowing cell contents etc.; also briefly mentions its generic table support.
Chapter 7: Constructing columns - describes how to layout text in columns; covers using single columns for finer control over text placement, text layout using multiple regular or irregular columns, setting tables and images along with text in columns, using columns to construct brochure-type layouts...
Chapter 8: Choosing the right font - thoroughly explains the various font formats supported, their pros and cons, and explains how to specify the font to use when laying out text.
Chapter 9: Using fonts - covers more "advanced" font usage: writing from right to left or vertically, choosing fonts for different languages, handling diacritics and ligatures...
Chapter 10: Constructing and painting paths - introduces the painting operations, and puts them into practice: drawing and filling shapes, decorating tables and cells, even converting simple SVG files to PDF!
Chapter 11: Adding color and text - explains the various color models and patterns available, image masks, clipping, and manipulating text as images.
Chapter 12: Drawing to Java Graphics2D - describes iText's implementation of the Graphics2D interface and some of its uses, including drawing high-resolution charts with JFreeChart; also covers optional content in PDF, which allows PDFs to selectively hide content and even provides for multilingual PDFs!
Chapter 13: Browsing a PDF document - covers PDF viewer-oriented features: specifying how the PDF should be displayed initially, providing thumbnails, transitions, bookmarks, links, and even executing JavaScript or external applications.
Chapter 14: Automating PDF creation - describes iText's page handling and page events, which allow you to create headers, footers, watermarks and the like; also covers PDF templates, and converting XML and XHTML documents to PDF.
Chapter 15: Creating annotations and fields - explains how to add annotations (comments, appearing either in tool-tips or Post-It-style pop-ups) and how to create and submit PDF-based forms (AcroForms), demonstrating both "manual" construction and iText's helper classes, and the different submission formats available.
Chapter 16: Filling and signing AcroForms - explains how to store and retrieve values in AcroForms, use forms as layout templates, replace forms with their read-only contents (which allows PDF files to handle workflows), and how to sign and verify PDF documents.
Chapter 17: iText in web applications - covers PDF production in web applications, with a particular focus on the many pitfalls awaiting such an endeavor: working around Internet Explorer's content type detection, Graphics2D issues on Unix-type platforms running application servers, problems in Internet Explorer with stream lengths...
Chapter 18: Under the hood - examines the structure of PDF files, and explains how iText can be extended to handle new PDF features; briefly provides tips for printing PDF documents.
The appendices contain class diagrams for the main classes in iText, a chapter on barcode generation, a description of Adobe Reader's command-line parameters, an example of PDF signing using a smartcard, a chapter on exceptions, and some information on PDF/X, PDF/A and Tagged PDF. The chapter on exceptions is of limited use, but the rest can come in useful if you need the features described.
The book suffers from "description by example" in some cases; in particular, chapter 10 is short on details such as the filling algorithms used, Bézier curves... This, and the complexity of some of the material involved, mean that to get the most benefit from the book you'll have to spend some time analyzing and adapting the examples, and reading the iText Javadocs and perhaps Adobe's PDF Reference. The author does warn of this himself, and it is understandable: the book is big enough as it is! And obviously you'll get more out of any technical book if you actually work through the examples...
Nevertheless the book is an enjoyable read, with an easy style and few mistakes. Certainly if you're using or evaluating iText you should read it, or at least have it handy to dip into relevant sections as you require various features. Readers curious about PDF will also learn a lot; iText in Action's main purpose may be to describe iText, but along the way it also describes PDF in great detail. You'll probably discover a few PDF features you didn't know about - enough perhaps to suggest new uses for PDF and iText in your projects!
The index is detailed enough for the book to be useful as a reference; in particular, all the iText classes you're likely to use are listed and point to the appropriate pages. The many examples also serve as an excellent source of inspiration; they implement many different iText use cases.
| Relevance | |
|---|---|
| Readability | |
| Overall | |