iText in Action - Errata / Addenda

Overview of corrections and updates to "iText in Action — Second Edition."

Front matter

iText® is now a Trademark, please add the designation ® the first time iText is mentioned in the book, and explain that it should be referred to as iText®

page x: the last item in 2.3 should be a new item: 2.4 Summary 56

page xxi §4: replace "I want to thank Adobe's PDF technical standards evangelist Leonard Rosenthol" with "I want to thank Adobe's PDF architect Leonard Rosenthol." Congratulations with the promotion, Leonard!

page xxv §4: add four words: "One special type of annotation in PDF is the widget annotation of an interactive form field."

Part 1 - Creating PDF documents from scratch

Chapter 1: Introducing PDF and iText

Figure 1.1: "Sign" should be removed from the first column.

Chapter 2: Using iText's basic building blocks

page 23: Listing 2.2: move Font font = new Font(...) outside the while loop.

page 36: "2.3.4 Summary" should be "2.4 Summary"

Chapter 3: Adding content at absolute positions

Chapter 4: Organizing content in tables

Chapter 5: Table, cell, and page events

p130 remove line 8 from the code sample: canvas.resetRGBColorStroke();

Part 2 - Manipulating existing PDF documents

Chapter 6: Working with existing PDFs

p186: add extra FAQ:

When I fill out the same form multiple times, the document is bloated. How can I avoid this?
When filling out a form, iText replaces the value of the form field and creates a new appearance for it. The old appearance remains in the PDF because it may be referred to from another place. If it isn't used by another object, you can remove it by calling reader.removeUnusedObjects() before closing the stamper.

p187: Listing 6.21: add copy.freeReader(reader) at the appropriate place. Add a code annotation to this line, saying "Keeps memory use low".

p187: add the following at the bottom of the page:
Note that the reader instances are kept in memory in the PdfCopy object until the document is closed. If you've copied all the pages you needed from the reader, you can free memory by using the freeReader() method.

p190: Listing 6.24: add copy.freeReader(reader) at the appropriate place.

Chapter 7: Making documents interactive

p195: [ebook only] figure should be "Figure 7.1" instead of "Figure 7.15"
p214: Listing 7.17: add copy.freeReader(reader); at the end of the for-loop.

Chapter 8: Filling out interactive forms

p275: Listing 8.28: replace "XMLDATA" with "xml" in the bold line.

p277: caption of figure 8.20 "Two workarounds to fill out a Reader Enabled form" should be "Two workarounds to fill out a Reader-enabled form"

Part 3 - Essential iText skills

Chapter 9: Integrating iText in your web applications

p 283: bullets "Using iText in servlets" should be the first bullet instead of the last.

p 287: The blank page problem:
Dominic Veit wrote: We have recently run into a problem with Internet Explorer that was not covered in your book. This chapter has saved us in many other cases. I thought you may want to add this new scenario to a subsequent version of the book.The problem is the IE 'blank page' problem, and it was caused by our including a cache-control header in the PDF response: Cache-control: no-cache="set-cookie, set-cookie2"
In our case, this header was added by a filter, and it was resolved by implementing an ignore list to the filter. IE does not like the set-cookie in the following header, and this will cause it to drop PDFs.

p307: The "NOTE The hostContainer property doesn't work on Mac OS X. Because of that limitation, this example may not work for you or a segment of your customers" is outdated. The example has been reported to work with Safari/Adobe Reader on Mac OS X, but not with Chrome.

p309: Listing 9.16: since iText 5.0.6, it's possible to use HTMLWorker.FONT_PROVIDER instead of "font_provider" and HTMLWorker.IMG_PROVIDER instead of "img_provider".

p311: Listing 9.18 line 2, replace HashMap with Map (since iText 5.0.6).

Chapter 10: Brightening your document with color and images

Chapter 11: Choosing the right font

p379: change "Hindic" into "Indic", and "a HindicLigaturizer" into "an IndicLigaturizer".

Chapter 12: Protecting your PDF

p382 Listing 12.2, line 4: replace HashMap with Map if you're using iText 5.1.1 or higher.

p408 in the part where it says "Creates OCSP client", replace:
ocsp = new OcspClientBouncyCastle((X509Certificate)chain[0], root, url).getEncoded();
with:
ocsp = new OcspClientBouncyCastle().getEncoded((X509Certificate)chain[0], root, url);
if you're using iText 5.1.3 or higher.

Part 4 - Under the hood

p 411: Replace the last sentence of §1 with "You'll learn that the body of a PDF file consists of a series of objects known as the Carousel Object System."

Chapter 13: PDFs inside-out

p422: add the following text right before the title PDF/A LEVEL A:

PDF/A LEVEL U
Level-U conformance includes all the requirements of level B, but also requires font dictionaries to have a ToUnicode entry whose value is a CMap stream objcet that maps character codes for at least all references glyphs to Unicode values.

p422: first line of the title PDF/A LEVEL A: replace "level-B" with "level U".

p422: final line.
"in the soon to be published ISO / AWI 14289." should be "in the soon to be published ISO 14289."
AWI stands for Approved Work Item. It's a status prior to a Working Draft. In January 2011, ISO 14289 was in the DIS stage: "Draft International Standard." It was discussed in the ISO meeting in Salt Lake City in May 2011. Normally, there should be an FDIS in the Summer of 2011: a Final Draft International Standard. If all goes well, the standard should be approved in the Fall.

Chapter 14: The imaging model

Chapter 15: Page content and structure

Chapter 16: PDF streams

p535: Listing 16.6: simpleXMLPareser.escapeXML(...) should be replaced with XmlUtil.escapeXML(...) for iText versions higher than 5.0.6

p559: figure 16.9 "Sign" must be removed from the first column.

Appendix