www.dbebooks.com - Free Books & magazines iText in Action iText in Action CREATING AND MANIPULATING PDF BRUNO LOWAGIE MANNING Greenwich (74° w. long.) For online information and ordering of this and other Manning books, go to 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. Cherokee Station PO Box 20386 Fax: (609) 877-8256 New York, NY 10021 email: [email protected] ©2007 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 they publish printed on acid-free paper, and we exert our best efforts to that end. Manning Publications Co. Cherokee Station Copyeditor: Tiffany Taylor PO Box 20386 Typesetter: Denis Dalinnik New York, NY 10021 Cover designer: Leslie Haimes ISBN 1932394796 Printed in the United States of America 1 2 3 4 5 6 7 8 9 10 – MAL – 10 09 08 07 06 To my wife, Ingeborg brief contents PART 1 INTRODUCTION ......................................................1 1 ■ iText: when and why 3 2 ■ PDF engine jump-start 30 3 ■ PDF: why and when 73 PART 2 BASIC BUILDING BLOCKS ......................................97 4 ■ Composing text elements 99 5 ■ Inserting images 135 6 ■ Constructing tables 162 7 ■ Constructing columns 193 PART 3 PDF TEXT AND GRAPHICS ..................................221 8 ■ Choosing the right font 223 9 ■ Using fonts 257 10 ■ Constructing and painting paths 283 vii viii BRIEF CONTENTS 11 ■ Adding color and text 325 12 ■ Drawing to Java Graphics2D 356 PART 4 INTERACTIVE PDF .............................................393 13 ■ Browsing a PDF document 395 14 ■ Automating PDF creation 425 15 ■ Creating annotations and fields 464 16 ■ Filling and signing AcroForms 501 17 ■ iText in web applications 533 18 ■ Under the hood 562 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 How iText was born 5 ■ iText today 7 Beyond Java 9 1.2 iText: first contact 10 Running the examples in the book 11 Experimenting with the iText toolbox 12 1.3 An almost-true story 14 Some Foobar fiction 15 ■ A document daydream 16 Welcoming the student 18 ■ Producing and processing interactive documents 23 ■ Making the dream come true 28 1.4 Summary 29 ix
Description: