PDF Reference, Second Edition
Total Page:16
File Type:pdf, Size:1020Kb
PDF Reference second edition Adobe Portable Document Format Version 1.3 Adobe Systems Incorporated ADDISON–WESLEY Boston • San Francisco • New York • Toronto • Montreal London • Munich • Paris • Madrid Capetown • Sydney • Tokyo • Singapore • Mexico City Library of Congress Cataloging-in-Publication Data Adobe portable document format, version 1.3 / Adobe Systems Incorporated. — 2nd ed. p. cm. Includes bibliographical references and index. ISBN 0-201-61588-6 1. Text processing (Computer science). 2. Adobe Acrobat. 3. Portable document software. I. Adobe Systems. QA76.76.T49 A36 2000 005.7′2—dc21 00-040581 © 1985–2000 Adobe Systems Incorporated. All rights reserved. NOTICE: All information contained herein is the property of Adobe Systems Incorporated. No part of this publication (whether in hardcopy or electronic form) may be reproduced or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written consent of the publisher. PostScript is a registered trademark of Adobe Systems Incorporated. All instances of the name PostScript in the text are references to the PostScript language as defined by Adobe Systems Incorporated unless otherwise stated. The name PostScript also is used as a product trademark for Adobe Systems’ implementation of the PostScript language interpreter. Except as other- wise stated, any mention of a “PostScript output device,” “PostScript printer,” “PostScript soft- ware,” or similar item refers to a product that contains PostScript technology created or licensed by Adobe Systems Incorporated, not to one that purports to be merely compatible. Adobe, the Adobe logo, Acrobat, the Acrobat logo, Adobe Garamond, Aldus, Distiller, Extreme, FrameMaker, Illustrator, InDesign, Minion, Myriad, PageMaker, Photoshop, Poetica, and PostScript are trademarks of Adobe Systems Incorporated. Apple, Mac, Macin- tosh, QuickDraw, and TrueType are trademarks of Apple Computer, Inc., registered in the United States and other countries. ITC Zapf Dingbats is a registered trademark of Interna- tional Typeface Corporation. Helvetica and Times are registered trademarks of Linotype-Hell AG and/or its subsidiaries. Microsoft and Windows are either registered trademarks or trade- marks of Microsoft Corporation in the United States and/or other countries. Times New Roman is a trademark of The Monotype Corporation registered in the U.S. Patent and Trade- mark Office and may be registered in certain other jurisdictions. Ryumin Light is a trademark of Morisawa & Co., Ltd. UNIX is a registered trademark of The Open Group. PANTONE is a registered trademark and Hexachrome is a trademark of Pantone, Inc. QuarkXPress is a trade- mark of Quark, Inc. and/or certain of the Quark Affiliated Companies, Reg. U.S. Pat. & Tm. Off. and in many other countries. Unicode is a registered trademark of Unicode, Inc. All other trademarks are the property of their respective owners. This publication and the information herein are furnished AS IS, are subject to change with- out notice, and should not be construed as a commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccura- cies, makes no warranty of any kind (express, implied, or statutory) with respect to this pub- lication, and expressly disclaims any and all warranties of merchantability, fitness for particular purposes, and noninfringement of third-party rights. 1 2 3 4 5 6 7 8 9-MA-0403020100 First printing, July 2000 iii Contents Preface xv Chapter 1: Introduction 1 1.1 About This Book 1 1.2 Introduction to PDF 1.3 Features 3 1.3 Related Publications 4 1.4 Copyright Permission 5 Chapter 2: Overview 7 2.1 Imaging Model 8 2.2 Other General Properties 12 2.3 Using PDF 17 2.4 PDF and the PostScript Language 19 Chapter 3: Syntax 21 3.1 Lexical Conventions 22 3.2 Objects 25 3.3 Details of Filtered Streams 41 3.4 File Structure 55 3.5 Encryption 64 3.6 Document Structure 71 3.7 Content Streams and Resources 82 3.8 Common Data Structures 86 3.9 Functions 95 3.10 File Specifications 107 Chapter 4: Graphics 119 4.1 Graphics Objects 120 4.2 Coordinate Systems 124 4.3 Graphics State 134 4.4 Path Construction and Painting 147 4.5 Color Spaces 157 4.6 Patterns 200 4.7 External Objects 243 4.8 Images 244 4.9 Form XObjects 263 4.10 PostScript XObjects 267 iv Contents Chapter 5: Fonts 269 5.1 Organization and Use of Fonts 269 5.2 Text State Parameters and Operators 278 5.3 Text Objects 285 5.4 Introduction to Font Data Structures 291 5.5 Simple Fonts 293 5.6 Composite Fonts 310 5.7 Font Descriptors 330 5.8 Embedded Font Programs 339 5.9 ToUnicode CMaps 342 Chapter 6: Rendering 347 6.1 CIE-Based Color to Device Color 348 6.2 Conversions among Device Color Spaces 350 6.3 Transfer Functions 354 6.4 Halftones 356 6.5 Scan Conversion Details 377 Chapter 7: Interactive Features 383 7.1 Viewer Preferences 383 7.2 Document-Level Navigation 384 7.3 Page-Level Navigation 391 7.4 Annotations 398 7.5 Actions 420 7.6 Interactive Forms 434 7.7 Sounds 468 7.8 Movies 470 Chapter 8: Document Interchange 473 8.1 Procedure Sets 473 8.2 Document Information Dictionary 474 8.3 File Identifiers 476 8.4 Application Data 477 8.5 Web Capture 507 8.6 Prepress Support 524 Appendix A: Operator Summary 539 Appendix B: Operators in Type 4 Functions 543 B.1 Arithmetic Operators 543 B.2 Relational, Boolean, and Bitwise Operators 544 B.3 Conditional Operators 544 B.4 Stack Operators 544 v Contents Appendix C: Implementation Limits 545 C.1 General Implementation Limits 546 C.2 Implementation Limits Affecting Web Capture 547 Appendix D: Character Sets and Encodings 549 D.1 Latin Character Set and Encodings 551 D.2 Expert Set and MacExpertEncoding 555 D.3 Symbol Set and Encoding 558 D.4 ZapfDingbats Set and Encoding 561 Appendix E: PDF Name Registry 563 Appendix F: Linearized PDF 565 F.1 Background and Assumptions 567 F.2 Linearized PDF Document Structure 569 F.3 Hint Tables 581 F.4 Access Strategies 591 Appendix G: Example PDF Files 597 G.1 Minimal PDF File 597 G.2 Simple Text String Example 600 G.3 Simple Graphics Example 602 G.4 Page Tree Example 605 G.5 Outline Tree Example 610 G.6 Updating Example 614 Appendix H: Compatibility and Implementation Notes 623 H.1 PDF Version Numbers 624 H.2 Dictionary Keys 625 H.3 Implementation Notes 625 Bibliography 643 Index 649 vii Figures 2.1 Creating PDF files using PDF Writer 18 2.2 Creating PDF files using Acrobat Distiller 19 3.1 PDF components 22 3.2 Initial structure of a PDF file 55 3.3 Structure of an updated PDF file 63 3.4 Structure of a PDF document 72 3.5 Inheritance of attributes 81 3.6 Mapping with the Decode array 101 4.1 Graphics objects 122 4.2 Device space 125 4.3 User space 127 4.4 Relationships among coordinate systems 129 4.5 Effects of coordinate transformations 130 4.6 Effect of transformation order 131 4.7 Miter length 141 4.8 Cubic Bézier curve generated by the c operator 151 4.9 Cubic Bézier curves generated by the v and y operators 151 4.10 Nonzero winding number rule 155 4.11 Even-odd rule 156 4.12 Color specification 158 4.13 Color rendering 159 4.14 Component transformations in a CIE-based ABC color space 166 4.15 Component transformations in a CIE-based A color space 167 4.16 Quadtone image using Indexed DeviceN 193 4.17 Output from Example 4.19 208 4.18 Output from Example 4.20 212 4.19 Radial shading 224 4.20 Starting a new triangle in a free-form Gouraud-shaded triangle mesh 227 4.21 Connecting triangles in a free-form Gouraud-shaded triangle mesh 228 4.22 Varying the value of the edge flag to create different shapes 229 4.23 Lattice-form triangular meshes 230 4.24 Coordinate mapping from a unit square to a four-sided Coons patch 233 4.25 Painted area and boundary of a Coons patch 234 4.26 Color values and edge flags in Coons patch meshes 236 4.27 Edge connections in a Coons patch mesh 237 viii Contents 4.28 Control points in a tensor-product mesh 239 4.29 Typical sampled image 244 4.30 Source image coordinate system 247 4.31 Mapping the source image 248 5.1 Glyphs painted in 50% gray 273 5.2 Glyph outlines treated as a stroked path 274 5.3 Graphics clipped by a glyph path 275 5.4 Glyph metrics 276 5.5 Metrics for horizontal and vertical writing modes 278 5.6 Character spacing in horizontal writing 281 5.7 Word spacing in horizontal writing 281 5.8 Horizontal scaling 282 5.9 Leading 282 5.10 Text rise 285 5.11 Operation of TJ operator in horizontal writing 289 5.12 Output from Example 5.9 304 5.13 Characteristics represented in the Flags entry of a font descriptor 333 6.1 Various halftoning effects 363 6.2 Halftone cell with a nonzero angle 369 6.3 Angled halftone cell divided into two squares 370 6.4 Halftone cell and two squares tiled across device space 370 6.5 Tiling of device space in a type 16 halftone 372 6.6 Flatness tolerance 378 6.7 Rasterization without stroke adjustment 381 7.1 Presentation timing 397 7.2 Open annotation 399 7.3 Coordinate adjustment with the NoRotate flag 404 7.4 Square and circle annotations 413 7.5 QuadPoints specification 414 7.6 FDF file structure 461 8.1 Simple Web Capture file structure 510 8.2 Complex Web Capture file structure 511 8.3 Page boundaries 526 8.4 Trapping example 529 G.1 Visual representation of Example G.3 603 G.2 Page tree for 62-page document 605 G.3 Document outline as displayed in Example G.5 610 G.4 Document outline as displayed in Example G.6 612 ix Tables 3.1 White-space characters 24 3.2 Escape sequences in literal strings 28 3.3 Examples of literal names using the # character