iText in Action: Creating and Manipulating PDF
暫譯: iText 實戰:創建與操作 PDF

Bruno Lowagie

  • 出版商: Manning
  • 出版日期: 2006-12-01
  • 售價: $1,880
  • 貴賓價: 9.5$1,786
  • 語言: 英文
  • 頁數: 656
  • 裝訂: Paperback
  • ISBN: 1932394796
  • ISBN-13: 9781932394795
  • 已過版

買這商品的人也買了...

相關主題

商品描述

Description

"any developer that 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, Thoughtworks

Say you need a tool to add dynamic or interactive features to a PDF file and you decide to search on Google for "Java PDF." What do you think you'd find? Why, at the top of the page you'd find "iText," of course. A leading tool for programmatic creation and manipulation of PDF documents, iText is an open source Java library developed and maintained by Bruno Lowagie, the author of this book, with the help of many contributors.

While at the entry level iText is easy to learn, developers find they soon need its more advanced features. Written by the master himself, iText in Action now offers an introduction and a practical guide to the subject--you will gain a sound understanding of the Portable Document Format and how to do interesting and useful things with PDF using iText.

iText in Action introduces iText and lowers the learning curve to its advanced features. Its numerous, valuable examples unlock many of the secrets hidden in Adobe's PDF Reference. The examples are in Java but they can be easily adapted to .NET using one of iText's .NET ports: iTextSharp (C#) or iText.NET (J#).

 

Table of Contents

preface xix
acknowledgments xxi
about this book xxiii

Part 1 Introduction   1

1 iText: when and why   3
1.1 The history of iText 5
1.2 iText: first contact 10
1.3 An almost-true story 14
1.4 Summary 29
2 PDF engine jump-start   30
2.1 Generating a PDF document in five steps 31
2.2 Manipulating existing PDF files 48
2.3 Creating PDF in multiple passes 68
2.4 Summary 72
3 PDF: why and when   73
3.1 A document history 74
3.2 Types of PDF 79
3.3 PDF version history 85
3.4 Summary 95

Part 2 Basic building blocks   97

4 Composing text elements   99
4.1 Wrapping Strings in text elements 100
4.2 Adding extra functionality to text elements 105
4.3 Chunk characteristics 111
4.4 Chunks and space distribution 118
4.5 Anchors revisited 122
4.6 Generic Chunk functionality 125
4.7 Making a flyer (part 1) 129
4.8 Summary 134
5 Inserting images   135
5.1 Standard image types 136
5.2 Working with java.awt.Image 140
5.3 Byte arrays with image data 143
5.4 Setting image properties 147
5.5 Making a flyer (part 2) 158
5.6 Summary 161
6 Constructing tables   162
6.1 Tables in PDF: PdfPTable 163
6.2 Alternatives to PdfPTable 186
6.3 Composing a study guide (part 1) 189
6.4 Summary 192
7 Constructing columns   193
7.1 Retrieving the current vertical position 194
7.2 Adding text to ColumnText 197
7.3 Composing ColumnText with other building blocks 206
7.4 Automatic columns with MultiColumnText 211
7.5 Composing a study guide (part 2) 216
7.6 Summary 219

Part 3 PDF text and graphics   221

8 Choosing the right font   223
8.1 Defining a font 224
8.2 Introducing base fonts 231
8.3 Composite fonts 248
8.4 Summary 255
9 Using fonts   257
9.1 Other writing directions 258
9.2 Sending a message of peace (part 1) 262
9.3 Advanced typography 264
9.4 Automating font creation and selection 271
9.5 Sending a message of peace (part 2) 279
9.6 Summary 282
10 Constructing and painting paths   283
10.1 Path construction and painting operators 284
10.2 Working with iText烞 direct content 294
10.3 Graphics state operators 303
10.4 Changing the coordinate system 313
10.5 Drawing a map of a city (part 1) 321
10.6 Summary 324
11 Adding color and text   325
11.1 Adding color to PDF files 326
11.2 The transparent imaging model 335
11.3 Clipping content 341
11.4 PDF烞 text state 344
11.5 The map of Foobar (part 2) 353
11.6 Summary 355
12 Drawing to Java Graphics2D   356
12.1 Obtaining a Java.awt.Graphics2D instance 357
12.2 Two-dimensional graphics in the real world 368
12.3 PDF烞 optional content 374
12.4 Enhancing the map of Foobar 385
12.5 Summary 392

Part 4 Interactive PDF   393

13 Browsing a PDF document   395
13.1 Changing viewer preferences 396
13.2 Visualizing thumbnails 401
13.3 Adding page transitions 405
13.4 Adding bookmarks 407
13.5 Introducing actions 415
13.6 Enhancing the course catalog 421
13.7 Summary 424
14 Automating PDF creation   425
14.1 Creating a page 426
14.2 Common page event functionality 432
14.3 Alternative XML solutions 445
14.4 Enhancing the course catalog (part 2) 461
14.5 Summary 463
15 Creating annotations and fields   464
15.1 Introducing annotations 465
15.2 Creating an AcroForm 475
15.3 Submitting a form 488
15.4 Comparing HTML and PDF forms 498
15.5 Summary 500
16 Filling and signing AcroForms  

商品描述(中文翻譯)

**描述**

「任何認真使用 iText 的開發者都會是個傻瓜,如果不買這本書。」
-- Dave Gilbert, jfree.org

「徹底且完整……將成為 iText 和 PDF 的長期寶貴資源。」
-- Alan Dennis, 軟體架構師, MyFamily.com

「我讀過的最佳技術書籍之一!出色的作品!」
-- Oliver Zeigermann, 技術訓練師, CoreMedia AG

「我全心全意推薦它。」
-- Doug James, eReporting 團隊負責人, Benefitfocus.com, Inc.

「令人印象深刻!它提供了深度而不會有太多噪音。」
-- Justin Lee, 總裁, Antwerkz Inc.

「對任何使用 PDF 的開發者來說都很有價值。」
-- Stuart Caborn, 顧問, Thoughtworks

假設你需要一個工具來為 PDF 文件添加動態或互動功能,並決定在 Google 上搜尋「Java PDF」。你認為你會找到什麼?當然,在頁面的頂部你會找到「iText」。作為一個用於程式化創建和操作 PDF 文件的領先工具,iText 是一個開源的 Java 函式庫,由本書的作者 Bruno Lowagie 開發和維護,並得到了許多貢獻者的幫助。

雖然 iText 在入門級別上易於學習,但開發者很快會發現他們需要更高級的功能。由大師本人撰寫的《iText in Action》現在提供了該主題的介紹和實用指南——你將對可攜式文檔格式有深入的理解,並學會如何使用 iText 進行有趣且有用的 PDF 操作。

《iText in Action》介紹了 iText,並降低了學習其高級功能的難度。其眾多有價值的範例揭示了 Adobe PDF 參考中隱藏的許多秘密。這些範例使用 Java 編寫,但可以輕鬆地適應 .NET,使用 iText 的 .NET 移植版本:iTextSharp (C#) 或 iText.NET (J#)。

**目錄**

前言 xix
致謝 xxi
關於本書 xxiii

第一部分 介紹 1
1 iText:何時及為何 3
1.1 iText 的歷史 5
1.2 iText:第一次接觸 10
1.3 一個幾乎真實的故事 14
1.4 總結 29
2 PDF 引擎啟動 30
2.1 五步生成 PDF 文件 31
2.2 操作現有 PDF 文件 48
2.3 多次創建 PDF 68
2.4 總結 72
3 PDF:為何及何時 73
3.1 文檔歷史 74
3.2 PDF 的類型 79
3.3 PDF 版本歷史 85
3.4 總結 95

第二部分 基本構建塊 97
4 組合文本元素 99
4.1 在文本元素中包裝字符串 100
4.2 為文本元素添加額外功能 105
4.3 Chunk 特性 111
4.4 Chunks 和空間分配 118
4.5 錨點重訪 122
4.6 通用 Chunk 功能 125
4.7 製作傳單(第一部分) 129
4.8 總結 134
5 插入圖像 135
5.1 標準圖像類型 136
5.2 使用 java.awt.Image 140
5.3 包含圖像數據的字節數組 143
5.4 設置圖像屬性 147
5.5 製作傳單(第二部分) 158
5.6 總結 161
6 構建表格 162
6.1 PDF 中的表格:PdfPTable 163
6.2 PdfPTable 的替代方案 186
6.3 組合學習指南(第一部分) 189
6.4 總結 192
7 構建列 193
7.1 獲取當前垂直位置 194
7.2 向 ColumnText 添加文本 197
7.3 與其他構建塊組合 ColumnText 206
7.4 使用 MultiColumnText 自動生成列 211
7.5 組合學習指南(第二部分) 216
7.6 總結 219

第三部分 PDF 文本和圖形 221
8 選擇合適的字體 223
8.1 定義字體 224
8.2 介紹基本字體 231
8.3 複合字體 248
8.4 總結 255
9 使用字體 257
9.1 其他書寫方向 258
9.2 發送和平的訊息(第一部分) 262
9.3 高級排版 264
9.4 自動化字體創建和選擇 271
9.5 發送和平的訊息(第二部分) 279
9.6 總結 282
10 構建和繪製路徑 283
10.1 路徑構建和繪製運算符 284
10.2 使用 iText 的直接內容 294
10.3 圖形狀態運算符 303
10.4 更改坐標系 313
10.5 繪製城市地圖(第一部分) 321
10.6 總結 324
11 添加顏色和文本 325
11.1 向 PDF 文件添加顏色 326
11.2 透明成像模型 335
11.3 剪裁內容 341
11.4 PDF 的文本狀態 344
11.5 Foobar 的地圖(第二部分) 353
11.6 總結 355
12 繪製到 Java Graphics2D 356
12.1 獲取 Java.awt.Graphics2D 實例 357
12.2 現實世界中的二維圖形 368
12.3 PDF 的可選內容 374
12.4 增強 Foobar 的地圖 385
12.5 總結 392

第四部分 互動 PDF 393
13 瀏覽 PDF 文件 395
13.1 更改查看器偏好設置 396
13.2 可視化縮略圖 401
13.3 添加頁面過渡 405
13.4 添加書籤 407
13.5 介紹動作 415
13.6 增強課程目錄 421
13.7 總結 424
14 自動化 PDF 創建 425
14.1 創建頁面 426
14.2 常見頁面事件功能 432
14.3 替代 XML 解決方案 445
14.4 增強課程目錄(第二部分) 461
14.5 總結 463
15 創建註釋和字段 464
15.1 介紹註釋 465
15.2 創建 AcroForm 475
15.3 提交表單 488
15.4 比較 HTML 和 PDF 表單 498
15.5 總結 500
16 填寫和簽署 AcroForms