[PDF] [PDF] iText in Action

Items 1 - 10 · 2 2 Adding Chunk, Phrase, Paragraph, and List objects 22 The Chunk 9 3 JavaScript communication between HTML and PDF 304 9 4 Creating 



Previous PDF Next PDF





[PDF] Developing Acrobat Applications Using JavaScript - Adobe

Reading the JavaScript for Acrobat API Reference 4 Creating and Modifying PDF Documents Methods for adding security to PDF documents



[PDF] iText in Action

Items 1 - 10 · 2 2 Adding Chunk, Phrase, Paragraph, and List objects 22 The Chunk 9 3 JavaScript communication between HTML and PDF 304 9 4 Creating 



[PDF] Digital Signatures for PDF documents - iText

2 3 3 Adding an empty signature field to an existing document using iText in the Adobe Acrobat JavaScript Reference Manual, which is out of scope in this 



[PDF] iText in Action Creating and Manipulating PDF - [Manning

2 1 Generating a PDF document in five steps 31 Creating a new 10 2 Working with iText's direct content 294 Adding JavaScript to a PDF document 420 □



[PDF] The Best iText Questions on StackOverflow - Leanpub

22 oct 2015 · add(new Paragraph("Hello World")); // step 5 document close(); Obviously, iText is capable of doing much more than creating a PDF that shows 



[PDF] Add Text Watermark To Using Itextsharp Github - Office Holidays

Download File PDF Add Text Watermark To Using Itextsharp Github Add Text extensive experience in PostScript and JavaScript and is the author of Adobe



[PDF] How to create PDFs in C# with HTML to PDF Converter - IronPDF

This C# PDF tutorial will guide you step-by-step how to convert an HTML page to PDF in Remember to add this statement to the top of any cs class file using IronPDF: Create a PDF Chart a live rendered dataset using d3 js and javascript



[PDF] Design and Generation of Interactive 3D PDFs for - Martin Pletscher

26 mai 2015 · To create the PDF and embed the U3D scene iTextSharp is used All JavaScript methods are supported by Adobe PDF since version 8



[PDF] les outils de conversion vers le format PDF - FranceArchives

14 jan 2014 · BILAN DES TESTS PAR FONCTIONNALITE DU PDF compression ; ICC= International Color Consortium ; Int=interne, JB2=JBIG2, JP2=JPEG2000, JS= JavaScript , OpenOffice, en ajoutant un « add-in » mais dans le cas de test, la création de fichiers PDF en Java ou C# [gratuit ou sous licence]



[PDF] Method for Effective PDF Files Manipulation Detection

17 mai 2017 · Include and document the scope/purpose of the examination as well as any Currently, PDF supports JS code inclusion and some JS is the addition of some elements by iText RUPS into a PDF file that is being explored

[PDF] itfactor boutique

[PDF] itgse

[PDF] itil service definition document template

[PDF] itil templates

[PDF] itn practice skills assessment packet tracer type b

[PDF] itron access

[PDF] itron careers

[PDF] itron cellular meter

[PDF] itron global sarl

[PDF] itron metering solutions uk limited

[PDF] itron water meter

[PDF] itron west union

[PDF] itu e.164 country code

[PDF] itu list of coast stations

[PDF] itu phone number format

MANNING

Bruno Lowagie

SECOND EDITIONCovers iText 5

Praise for the First Edition

Each aspect is explained with numerous examples that can be applied to real-world problems right away.

—Ulf Ditmer, JavaRanch

Any developer who is making serious use of iText would be a fool not to buy this book.

—Dave Gilbert, jfree.org

Thorough and complete ... will be a long-running, valuable resource for iText and PDF.

—Alan Dennis

Software Architect, MyFamily.com

One of the best technical books I have ever read! Great work!

—Oliver Zeigermann

Technical Trainer, CoreMedia AG

I wholeheartedly recommend it.

—Doug James

eReporting Team Lead, Benefitfocus.com, Inc. Impressive! It provides depth without all the noise.

—Justin Lee, President, Antwerkz Inc.

Valuable to any developer using PDF.

—Stuart Caborn, Consultant, ThoughtworksLicensed to Bruno Lowagie

Licensed to Bruno Lowagie

iText in Action

Second Edition

BRUNO LOWAGIE

MANNING

Greenwich

(74° w. long.)Licensed to Bruno Lowagie For online information and ordering of this and other Manning books, please visit www.manning.com . The publisher offers discounts on this book when ordered in quantity.

For more information, please contact

Special Sales Department

Manning Publications Co.

180 Broad Street

Suite 1323

Stamford, CT 06901

Email: orders@manning.com

©2011 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning"s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15 percent recycled and processed without the use of elemental chlorine. Manning Publications Co.Development editor:Katharine Osborne

180 Broad Street, Suite 1323 Copyeditor: Andy Carroll

Stamford, CT 06901 Cover designer: Marija Tudor

Typesetter: Gordan Salinovic

ISBN 9781935182610

Printed in the United States of America

12345678910-MAL -151413121110Licensed to Bruno Lowagie

To Ingeborg, Inigo, and JagoLicensed to Bruno Lowagie

Licensed to Bruno Lowagie

vii brief contents PART 1CREATING PDF DOCUMENTS FROM SCRATCH.................1

1Introducing PDF and iText 3

2

Using iText's basic building blocks 20

3

Adding content at absolute positions 57

4

Organizing content in tables 93

5

Table, cell, and page events 122

PART 2MANIPULATING EXISTING PDF DOCUMENTS...............157

6Working with existing PDFs 159

7

Making documents interactive 194

8

Filling out interactive forms 236

PART 3ESSENTIAL ITEXT SKILLS............................................281

9Integrating iText in your web applications 283

10 Brightening your document with color and images 317 11

Choosing the right font 349

12 Protecting your PDF 380Licensed to Bruno Lowagie

BRIEF CONTENTSviii

PART 4UNDER THE HOOD.....................................................411

13PDFs inside-out 413

14

The imaging model 452

15

Page content and structure 493

16 PDF streams 526Licensed to Bruno Lowagie ix contents preface xvii preface to the first edition xviv acknowledgments xxi about this book xxiii about the title xxviii about the cover illustration xxix

PART 1CREATING PDF DOCUMENTS FROM SCRATCH......1

1

Introducing PDF and iText 3

1.1 Things you can do with PDF 4

1.2 Working with the examples in this book 6

1.3 Creating a PDF document in five steps with iText 8

Creating a new Document object 9

Getting a PdfWriter

instance 12

Opening the Document 13

Adding

content 15

Closing the Document 17

1.4 Summary 19Licensed to Bruno Lowagie

CONTENTSx

2

Using iText"s basic building blocks 20

2.1 Illustrating the examples with a real-world database 21

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

The Chunk object: a String, a Font, and some attributes 23

The Phrase

object: a List of Chunks with leading 25

Paragraph object: a Phrase

with extra properties and a newline 30

Distributing text over different

lines 34 The List object: a sequence of Paragraphs called ListItem 37 The DrawInterface: vertical position marks, separators, and tabs 41

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

The Anchor object: internal and external links 47

Chapter and

Section: get bookmarks for free 49

The Image object: adding raster

format illustrations 51

Summary 56

3

Adding content at absolute positions 57

3.1 Introducing the concept of direct content 58

Direct content layers 58

Graphics state and text state 60

A real-

world database: three more tables 62

3.2 Adding text at absolute positions 67

Convenience method: PdfContentByte.showTextAligned() 67 Convenience method: ColumnText.showTextAligned() 70

3.3 Working with the ColumnText object 74

Using ColumnText in text mode 75

Using ColumnText in

composite mode 81

3.4 Creating reusable content 84

Image XObjects 84

The PdfTemplate object 87

3.5 Summary 92

4

Organizing content in tables 93

4.1 Constructing tables 94

Your first PdfPTable 94

PdfPTable properties 95

4.2 Changing the properties of a cell 98

PdfPCell in text mode 99

PdfPCell in composite mode 107

4.3 Dealing with large tables 112

Repeating headers and footers 112

Splitting tables 113

Memory management for LargeElement implementations 115

4.4 Adding a table at an absolute position 116

Working with writeSelectedRows() 116

Wrapping tables in

columns 119

4.5 Summary 121Licensed to Bruno Lowagie

CONTENTSxi

5

Table, cell, and page events 122

5.1 Decorating tables using table and cell events 123

Implementing the PdfPTableEvent interface 123

Implementing the

PdfPCellEvent interface 125

Combining table and cell events 128

5.2 Events for basic building blocks 133

Generic Chunk functionality 134

Paragraph events 138

Chapter

and Section events 138

Page order and blank pages 141

5.3 Overview of the page boundaries 142

The media box 143

The crop box 145

Other page boundaries 147

5.4 Adding page events to PdfWriter 148

Adding a header and a footer 148

Solving the "page X of Y"

problem 150

Adding a watermark 152

Creating a

slideshow 154

5.5 Summary 155

PART 2MANIPULATING EXISTING PDF DOCUMENTS...157

6

Working with existing PDFs 159

6.1 Accessing an existing PDF with PdfReader 160

Retrieving information about the document and its pages 160

Reducing the memory use of PdfReader 163

6.2 Copying pages from existing PDF documents 164

Importing pages 165

Scaling and superimposing pages 167

N-up copying and tiling PDF documents 170

6.3 Adding content with PdfStamper 173

Adding content at absolute positions 173

Creating a PDF in multiple

passes 175 Adding company stationery to an existing document 176

Inserting pages into an existing document 178

Filling out a PDF

form 179

6.4 Copying pages with PdfCopy 186

Concatenating and splitting PDF documents 187

PdfCopy

versus PdfSmartCopy 189

Concatenating forms 191

6.5 Summary 192

7

Making documents interactive 194

7.1 Introducing actions 195

Document-navigation actions 195

Explicit destinations 199

JavaScript in PDF documents 202

More actions 205Licensed to Bruno Lowagie

CONTENTSxii

7.2 Adding bookmarks 208

Creating bookmarks for a new document 208

Retrieving

bookmarks from an existing document 210

Adding bookmarks to

an existing document 212

Concatenating documents with

bookmarks 213

Open parameters 214

7.3 Creating annotations 215

Text annotations 215

Link annotations 220

File attachments 222

Stamp, line, and rectangle annotations 224

7.4 JavaScript programming in PDF 226

Triggering JavaScript from a button 226

Showing and hiding

an annotation 227

A popup triggered by a button that doesn"t

need to be pushed 229

Additional actions 231

A PDF calculator 232

7.5 Summary 234

8

Filling out interactive forms 236

8.1 Introducing AcroForms 237

8.2 Selecting states or trigger actions with button fields 238

Radio fields and radio buttons 238

Check boxes 240

Pushbuttons 241

8.3 Filling in data with text fields 244

Creating text fields 244

Filling out text fields 247

Text fields

and fonts 249

Validating text fields 252

8.4 Selecting options with choice fields 252

Creating lists and combo boxes 253

Manipulating lists and

combo boxes 255

8.5 Refining the form-filling process 255

Choosing field names 256

Optimizing the filling process 257

Partial form flattening 258

Customized form flattening 260

8.6 Introducing the XML Forms Architecture (XFA) 264

Static XFA forms 265

Dynamic XFA forms 270

8.7 Preserving the usage rights of Reader-enabled forms 275

Reader-enabling a form using Adobe Acrobat 276

Filling out

Reader-enabled forms using iText 277

8.8 Summary 278Licensed to Bruno Lowagie

CONTENTSxiii

PART 3ESSENTIAL ITEXT SKILLS................................281 9

Integrating iText in your web applications 283

9.1 Creating a PDF from a servlet 284

The five steps of PDF creation in a web application 284

Troubleshooting

web applications 286

Generating a PDF from a JSP page 291

9.2 Making a form "web ready" 293

Adding a submit button to an existing form 293

Filling out a form on

the server side 298

FDF and XFDF in web applications 299

9.3 JavaScript communication between HTML and PDF 304

9.4 Creating basic building blocks from HTML and XML 307

Parsing HTML 308

Parsing XML 312

9.5 Summary 315

10 Brightening your document with color and images 317

10.1 Working with the iText color classes 318

Device colors 318

Spot colors 320

Painting patterns 321

Transparency 325

10.2 Overview of supported image types 329

JPEG, JPEG2000, GIF, PNG, BM

P, WMF, TIFF, and JBIG2 330

Creating a raw image 332

CCITT compressed images 333

Creating barcodes 334

Working with java.awt.Image 338

Compressing images 338

Images consisting of multiple pages or

frames 340

10.3 Making images transparent 341

Images and transparency 341

Masking images 344

Clipping

images 345

10.4 Summary 348

11

Choosing the right font 349

11.1 Getting fonts from a file 349

Font files and their extensions 350

Type 1 fonts 352

TrueType

and OpenType fonts 353

11.2 Examining font types from a PDF perspective 354

Simple fonts 355

Composite fonts 357Licensed to Bruno Lowagie

CONTENTSxiv

11.3 Using fonts in iText 359

Overview of the Font classes 359

Type 3 fonts 361

CJK fonts 363

Writing from right to left 366

Advanced

typography 369

11.4 Automating font creation and selection 373

Getting a Font from the FontFactory 374

Automatic font

selection 377

11.5 Summary 379

12

Protecting your PDF 380

12.1 Adding metadata 381

The info dictionary 381

The Extensible Metadata Platform

(XMP) 383

12.2 PDF and compression 385

Compression levels 385

Compressing and decompressing existing

files 386

12.3 Encrypting a PDF document 387

Creating a password-encrypted PDF 387

Public-key

encryption 390

12.4 Digital signatures, OCSP, and timestamping 395

Creating an unsigned signature field 395

Signing a

PDF 396

Adding multiple signatures 399

Verifying the

signatures in a document 402

Creating the digest and signing

externally 403

CRLs, OCSP, and timestamping 405

PDF Advanced Electronic Signatures (PAdES) profiles 409

12.5 Summary 410

PART 4UNDER THE HOOD.........................................411 13

PDFs inside-out 413

13.1 PDF, why and how? 414

The ancestors of PDF 414

The history of PDF 414

PDF as

an ISO standard 418

PDF/X, PDF/A, PDF/E, PDF/UA, and

other types of PDF 419

13.2 Understanding the Carousel Object System 424

Basic PDF objects 424

The PDF file structure 426

Climbing

up the object tree 432Licensed to Bruno Lowagie

CONTENTSxv

13.3 Exploring the root of a PDF file 434

Page layout, page mode, and viewer preferences 435

Pages and page

labels 441

Outlines, destinations, and names 446

AcroForms

revisited 447

13.4 Summary 451

14

The imaging model 452

14.1 Examining the content stream 453

14.2 Path construction and painting operators 454

Constructing paths 454

Painting and clipping paths 456

Convenience methods to draw shapes 459

14.3 Overview of the graphics state methods 460

Line characteristics 461

Colors 464

Changing the

coordinate system 466

Affine transformations using Java 470

14.4 Overview of the text and text state methods 471

quotesdbs_dbs17.pdfusesText_23