Preface |
|
xvii | |
Preface to the first edition |
|
xviv | |
acknowledgments |
|
xxi | |
about this book |
|
xxiii | |
about the title |
|
xxviii | |
about the cover illustration |
|
xxix | |
|
PART 1 CREATING PDF DOCUMENTS FROM SCRATCH... |
|
|
1 | (156) |
|
1 Introducing PDF and iText |
|
|
3 | (17) |
|
1.1 Things you can do with PDF |
|
|
4 | (2) |
|
1.2 Working with the examples in this book |
|
|
6 | (2) |
|
1.3 Creating a PDF document in five steps with iText |
|
|
8 | (11) |
|
Creating a new Document object |
|
|
9 | (3) |
|
Getting a PdfWriter instance |
|
|
12 | (1) |
|
|
13 | (2) |
|
|
15 | (2) |
|
|
17 | (2) |
|
|
19 | (1) |
|
2 Using iText's basic building blocks |
|
|
20 | (37) |
|
2.1 Illustrating the examples with a real-world database |
|
|
21 | (1) |
|
2.2 Adding Chunk, Phrase, Paragraph, and List objects |
|
|
22 | (24) |
|
The Chunk object: a String, a Font, and some attributes |
|
|
23 | (2) |
|
The Phrase object: a List of Chunks with leading |
|
|
25 | (5) |
|
Paragraph object: a Phrase with extra properties and a newline |
|
|
30 | (4) |
|
Distributing text over different lines |
|
|
34 | (3) |
|
The List object: a sequence of Paragraphs called ListItem |
|
|
37 | (4) |
|
The DrawInterface: vertical position marks, separators, and tabs |
|
|
41 | (5) |
|
2.3 Adding Anchor, Image, Chapter, and Section objects |
|
|
46 | (11) |
|
The Anchor object: internal and external links |
|
|
47 | (2) |
|
Chapter and Section: get bookmarks for free |
|
|
49 | (2) |
|
The Image object: adding raster format illustrations |
|
|
51 | (5) |
|
|
56 | (1) |
|
3 Adding content at absolute positions |
|
|
57 | (36) |
|
3.1 Introducing the concept of direct content |
|
|
58 | (9) |
|
|
58 | (2) |
|
Graphics state and text state |
|
|
60 | (2) |
|
A real-world database: three more tables |
|
|
62 | (5) |
|
3.2 Adding text at absolute positions |
|
|
67 | (7) |
|
Convenience method: PdfContentByte.show TextAligned() |
|
|
67 | (3) |
|
Convenience method: Column Text.showTextAligned() |
|
|
70 | (4) |
|
3.3 Working with the Column Text object |
|
|
74 | (10) |
|
Using Column Text in text mode |
|
|
75 | (6) |
|
Using Column Text in composite mode |
|
|
81 | (3) |
|
3.4 Creating reusable content |
|
|
84 | (8) |
|
|
84 | (3) |
|
|
87 | (5) |
|
|
92 | (1) |
|
4 Organizing content in tables |
|
|
93 | (29) |
|
|
94 | (4) |
|
|
94 | (1) |
|
|
95 | (3) |
|
4.2 Changing the properties of a cell |
|
|
98 | (14) |
|
|
99 | (8) |
|
PdfPCell in composite mode |
|
|
107 | (5) |
|
4.3 Dealing with large tables |
|
|
112 | (4) |
|
Repeating headers and footers |
|
|
112 | (1) |
|
|
113 | (2) |
|
Memory management for LargeElement implementations |
|
|
115 | (1) |
|
4.4 Adding a table at an absolute position |
|
|
116 | (5) |
|
Working with writeSelectedRows() |
|
|
116 | (3) |
|
Wrapping tables in columns |
|
|
119 | (2) |
|
|
121 | (1) |
|
5 Table, cell, and page events |
|
|
122 | (35) |
|
5.1 Decorating tables using table and cell events |
|
|
123 | (10) |
|
Implementing the PdfPTableEvent interface |
|
|
123 | (2) |
|
Implementing the PdfPCellEvent interface |
|
|
125 | (3) |
|
Combining table and cell events |
|
|
128 | (5) |
|
5.2 Events for basic building blocks |
|
|
133 | (9) |
|
Generic Chunk functionality |
|
|
134 | (4) |
|
|
138 | (1) |
|
Chapter and Section events |
|
|
138 | (3) |
|
Page order and blank pages |
|
|
141 | (1) |
|
5.3 Overview of the page boundaries |
|
|
142 | (6) |
|
|
143 | (2) |
|
|
145 | (2) |
|
|
147 | (1) |
|
5.4 Adding page events to PdfWriter |
|
|
148 | (7) |
|
Adding a header and a footer |
|
|
148 | (2) |
|
Solving the "page X of Y" problem |
|
|
150 | (2) |
|
|
152 | (2) |
|
|
154 | (1) |
|
|
155 | (2) |
|
PART 2 MANUPULATING EXISTING PDF DOCUMENTS... |
|
|
157 | (124) |
|
6 Working with existing PDFs |
|
|
159 | (35) |
|
6.1 Accessing an existing PDF with PdfReader |
|
|
160 | (4) |
|
Retrieving information about the document and its pages |
|
|
160 | (3) |
|
Reducing the memory use of PdfReader |
|
|
163 | (1) |
|
6.2 Copying pages from existing PDF documents |
|
|
164 | (9) |
|
|
165 | (2) |
|
Scaling and superimposing pages |
|
|
167 | (3) |
|
N-up copying and tiling PDF documents |
|
|
170 | (3) |
|
6.3 Adding content with PdfStamper |
|
|
173 | (13) |
|
Adding content at absolute positions |
|
|
173 | (2) |
|
Creating a PDF in multiple passes |
|
|
175 | (1) |
|
Adding company stationery to an existing document |
|
|
176 | (2) |
|
Inserting pages into an existing document |
|
|
178 | (1) |
|
|
179 | (7) |
|
6.4 Copying pages with PdfCopy |
|
|
186 | (6) |
|
Concatenating and splitting PDF documents |
|
|
187 | (2) |
|
PdfCopyversus PdfSmartCopy |
|
|
189 | (2) |
|
|
191 | (1) |
|
|
192 | (2) |
|
7 Making documents interactive |
|
|
194 | (42) |
|
|
195 | (13) |
|
Document-navigation actions |
|
|
195 | (4) |
|
|
199 | (3) |
|
JavaScript in PDF documents |
|
|
202 | (3) |
|
|
205 | (3) |
|
|
208 | (7) |
|
Creating bookmarks for a new document |
|
|
208 | (2) |
|
Retrieving bookmarks from an existing document |
|
|
210 | (2) |
|
Adding bookmarks to an existing document |
|
|
212 | (1) |
|
Concatenating documents with bookmarks |
|
|
213 | (1) |
|
|
214 | (1) |
|
|
215 | (11) |
|
|
215 | (5) |
|
|
220 | (2) |
|
|
222 | (2) |
|
Stamp, line, and rectangle annotations |
|
|
224 | (2) |
|
7.4 JavaScript programming in PDF |
|
|
226 | (8) |
|
Triggering JavaScript from a button |
|
|
226 | (1) |
|
Showing and hiding an annotation |
|
|
227 | (2) |
|
A popup triggered by a button that doesn't need to be pushed |
|
|
229 | (2) |
|
|
231 | (1) |
|
|
232 | (2) |
|
|
234 | (2) |
|
8 Filling out interactive forms |
|
|
236 | (45) |
|
8.1 Introducing AcroForms |
|
|
237 | (1) |
|
8.2 Selecting states or trigger actions with button fields |
|
|
238 | (6) |
|
Radio fields and radio buttons |
|
|
238 | (2) |
|
|
240 | (1) |
|
|
241 | (3) |
|
8.3 Filling in data with text fields |
|
|
244 | (8) |
|
|
244 | (3) |
|
|
247 | (2) |
|
|
249 | (3) |
|
|
252 | (1) |
|
8.4 Selecting options with choice fields |
|
|
252 | (3) |
|
Creating lists and combo boxes |
|
|
253 | (2) |
|
Manipulating lists and combo boxes |
|
|
255 | (1) |
|
8.5 Refining the form-filling process |
|
|
255 | (9) |
|
|
256 | (1) |
|
Optimizing the filling process |
|
|
257 | (1) |
|
|
258 | (2) |
|
Customized form flattening |
|
|
260 | (4) |
|
8.6 Introducing the XML Forms Architecture (XFA) |
|
|
264 | (11) |
|
|
265 | (5) |
|
|
270 | (5) |
|
8.7 Preserving the usage rights of Reader-enabled forms |
|
|
275 | (3) |
|
Reader-enabling a form using Adobe Acrobat |
|
|
276 | (1) |
|
Filling out Reader-enabled forms using iText |
|
|
277 | (1) |
|
|
278 | (3) |
|
PART 3 ESSENTIAL ITEXT SKILLS |
|
|
281 | (130) |
|
9 Integrating iText in your web applications |
|
|
283 | (34) |
|
9.1 Creating a PDF from a servlet |
|
|
284 | (9) |
|
The five steps of PDF creation in a web application |
|
|
284 | (2) |
|
Troubleshooting web applications |
|
|
286 | (5) |
|
Generating a PDF from a JSP page |
|
|
291 | (2) |
|
9.2 Making a form "web ready" |
|
|
293 | (11) |
|
Adding a submit button to an existing form |
|
|
293 | (5) |
|
Filling out a form on the server side |
|
|
298 | (1) |
|
FDF and XFDF in web applications |
|
|
299 | (5) |
|
9.3 JavaScript communication between HTML and PDF |
|
|
304 | (3) |
|
9.4 Creating basic building blocks from HTML and XML |
|
|
307 | (8) |
|
|
308 | (4) |
|
|
312 | (3) |
|
|
315 | (2) |
|
10 Brightening your document with color and images |
|
|
317 | (32) |
|
10.1 Working with the iText color classes |
|
|
318 | (11) |
|
|
318 | (2) |
|
|
320 | (1) |
|
|
321 | (4) |
|
|
325 | (4) |
|
10.2 Overview of supported image types |
|
|
329 | (12) |
|
JPEG, JPEG2000, GIF, PNG, BMP, WMF, TIFF, and JBIG2 |
|
|
330 | (2) |
|
|
332 | (1) |
|
|
333 | (1) |
|
|
334 | (4) |
|
Working with java.awt.Image |
|
|
338 | (1) |
|
|
338 | (2) |
|
Images consisting of multiple pages or frames |
|
|
340 | (1) |
|
10.3 Making images transparent |
|
|
341 | (7) |
|
|
341 | (3) |
|
|
344 | (1) |
|
|
345 | (3) |
|
|
348 | (1) |
|
11 Choosing the right font |
|
|
349 | (31) |
|
11.1 Getting fonts from a file |
|
|
349 | (5) |
|
Font files and their extensions |
|
|
350 | (2) |
|
|
352 | (1) |
|
TrueType and Open Type fonts |
|
|
353 | (1) |
|
11.2 Examining font types from a PDF perspective |
|
|
354 | (5) |
|
|
355 | (2) |
|
|
357 | (2) |
|
11.3 Using fonts in iText |
|
|
359 | (14) |
|
Overview of the Font classes |
|
|
359 | (2) |
|
|
361 | (2) |
|
|
363 | (3) |
|
Writing from right to left |
|
|
366 | (3) |
|
|
369 | (4) |
|
11.4 Automating font creation and selection |
|
|
373 | (6) |
|
Getting a Font from the FontFactory |
|
|
374 | (3) |
|
|
377 | (2) |
|
|
379 | (1) |
|
|
380 | (31) |
|
|
381 | (4) |
|
|
381 | (2) |
|
The Extensible Metadata Platform (XMP) |
|
|
383 | (2) |
|
|
385 | (2) |
|
|
385 | (1) |
|
Compressing and decompressing existing files |
|
|
386 | (1) |
|
12.3 Encrypting a PDF document |
|
|
387 | (8) |
|
Creating a password-encrypted PDF |
|
|
387 | (3) |
|
|
390 | (5) |
|
12.4 Digital signatures, OCSP, and timestamping |
|
|
395 | (15) |
|
Creating an unsigned signature field |
|
|
395 | (1) |
|
|
396 | (3) |
|
Adding multiple signatures |
|
|
399 | (3) |
|
Verifying the signatures in a document |
|
|
402 | (1) |
|
Creating the digest and signing externally |
|
|
403 | (2) |
|
CRLs, OCSP, and timestamping |
|
|
405 | (4) |
|
PDF Advanced Electronic Signatures (PAdES) profiles |
|
|
409 | (1) |
|
|
410 | (1) |
|
|
411 | (152) |
|
|
413 | (39) |
|
|
414 | (10) |
|
|
414 | (1) |
|
|
414 | (4) |
|
|
418 | (1) |
|
PDF/X, PDF/A, PDF/E, PDF/UA, and other types of PDF |
|
|
419 | (5) |
|
13.2 Understanding the Carousel Object System |
|
|
424 | (10) |
|
|
424 | (2) |
|
|
426 | (6) |
|
Climbing up the object tree |
|
|
432 | (2) |
|
13.3 Exploring the root of a PDF file |
|
|
434 | (17) |
|
Page layout, page mode, and viewer preferences |
|
|
435 | (6) |
|
|
441 | (5) |
|
Outlines, destinations, and names |
|
|
446 | (1) |
|
|
447 | (4) |
|
|
451 | (1) |
|
|
452 | (41) |
|
14.1 Examining the content stream |
|
|
453 | (1) |
|
14.2 Path construction and painting operators |
|
|
454 | (6) |
|
|
454 | (2) |
|
Painting and clipping paths |
|
|
456 | (3) |
|
Convenience methods to draw shapes |
|
|
459 | (1) |
|
14.3 Overview of the graphics state methods |
|
|
460 | (11) |
|
|
461 | (3) |
|
|
464 | (2) |
|
Changing the coordinate system |
|
|
466 | (4) |
|
Affine transformations using Java |
|
|
470 | (1) |
|
14.4 Overview of the text and text state methods |
|
|
471 | (6) |
|
|
471 | (1) |
|
Text-positioning and text-showing operators |
|
|
472 | (4) |
|
Convenience methods for text |
|
|
476 | (1) |
|
14.5 Using java.awt.Graphics2D |
|
|
477 | (15) |
|
Drawing content to PdfGraphics2D |
|
|
478 | (5) |
|
Drawing text to PdfGraphics2D |
|
|
483 | (9) |
|
|
492 | (1) |
|
15 Page content and structure |
|
|
493 | (33) |
|
15.1 Making content visible or invisible |
|
|
493 | (13) |
|
|
494 | (1) |
|
Adding structure to layers |
|
|
495 | (5) |
|
Optional content membership |
|
|
500 | (1) |
|
Changing the state of a layer with an action |
|
|
501 | (2) |
|
Optional content in XObjects and annotations |
|
|
503 | (3) |
|
15.2 Working with marked content |
|
|
506 | (8) |
|
|
506 | (2) |
|
Section 508 and accessibility |
|
|
508 | (3) |
|
|
511 | (3) |
|
|
514 | (11) |
|
Examining the content stream with PRTokeniser |
|
|
514 | (3) |
|
Processing content streams with PdfContentStreamProcessor |
|
|
517 | (2) |
|
Extracting text with PdfReaderContentParser and PdfTextExtractor |
|
|
519 | (4) |
|
|
523 | (1) |
|
|
524 | (1) |
|
|
525 | (1) |
|
|
526 | (37) |
|
16.1 Finding and replacing image and font streams |
|
|
526 | (7) |
|
Adding a special ID to an Image |
|
|
527 | (1) |
|
Resizing an image in an existing document |
|
|
528 | (1) |
|
|
529 | (2) |
|
|
531 | (2) |
|
16.2 Embedding files into a PDF |
|
|
533 | (12) |
|
File attachment annotations |
|
|
533 | (2) |
|
Document-level attachments |
|
|
535 | (1) |
|
Go to embedded file action |
|
|
536 | (2) |
|
PDF packages, portable collections, or portfolios |
|
|
538 | (7) |
|
16.3 Integrating rich media |
|
|
545 | (13) |
|
|
545 | (1) |
|
|
546 | (2) |
|
Embedding Flash into a PDF |
|
|
548 | (7) |
|
Establishing communication between Flex and PDF |
|
|
555 | (3) |
|
|
558 | (5) |
appendix A Bibliography |
|
563 | (2) |
appendix B Useful links |
|
565 | (4) |
index |
|
569 | |