logo资料库

Adobe+Reader+插件开发人员入men.pdf

第1页 / 共253页
第2页 / 共253页
第3页 / 共253页
第4页 / 共253页
第5页 / 共253页
第6页 / 共253页
第7页 / 共253页
第8页 / 共253页
资料共253页,剩余部分请下载后查看
Contents
List of Examples
Preface
What’s in this guide
Who should read this guide?
Related documentation
Introduction
About plug-ins
About the Acrobat core API
Acrobat core API objects
Acrobat core API methods
Data types
About PDF Library and plug-in applications
Manipulating Acrobat Professional, Acrobat Standard, and Adobe Reader
Displaying a PDF document in an external window
Indexed searching
Modifying file access
Creating new annotation types
Dynamically adding text to PDF documents
Understanding your target application
New Acrobat core APIs
Understanding Plug-ins
About plug-in initialization
Plug-in loading and initialization
Handshaking and Initialization
Exporting HFTs
Importing HFTs and registering for notifications
Initialization
Unloading
Summarizing a plug-in’s life cycle
Using callback functions
Notifications
Handling events
Mouse clicks
Adjust cursor
Key presses
Using plug-in prefixes
Obtaining a developer prefix
Using a developer prefix
Plug-in name
Menu prefixes
Menu items prefixes
Tool prefixes
Toolbar button prefixes
Private data prefixes
Action prefixes
Annotation prefixes
HFT prefixes
Modifying the Acrobat or Adobe Reader user interface
Adding or removing menus and menu items
Modifying toolbars
Controlling the About box and splash screen
Creating help files
User interface guidelines
Acquiring and releasing objects
Debugging plug-ins
Page view layers
Minimizing screen redrawing
Storing private data in PDF files
Exporting data from PDF document objects
Creating Plug-in and PDF Library Applications
Supported environments
Working with platform-specific techniques
About platform-dependent data
Portability techniques
Windows techniques
Developing a Windows plug-in
Locating and loading plug-ins
Why a plug-in might not load
Macros and project settings
Interapplication communication
Debugging
Handling the thread local storage (TLS) limit
Using modal dialog boxes
Mac OS techniques
Developing a Mac OS plug-in
Locating and loading plug-ins\
Using memory
Resource file considerations
Mac OS-only methods
Interapplication communication
Creating a sample plug-in
Including Acrobat SDK library files
Adding the PIMain source file
Adding application logic
Compiling and building your plug-in
Creating a sample PDF Library application
Contents of the PDF Library SDK
Including library files
Sample code
Developing applications with the Adobe PDF Library
Windows
Mac OS
UNIX
Initialization and termination
Multithreading
Upgrading existing plug-ins
Detecting supported APIs
Updates to ASCoord and AVRect
Upgrading plug-ins in Windows
Upgrading plug-ins on Mac OS
Migrating a PDF Library application from CodeWarrior to Xcode
Inserting Text into PDF Documents
About inserting text into a PDF document
Creating a new PDF document
Creating a new page
Creating a container
Acquiring fonts
Creating a PDEGraphicState object
Creating an ASFixedMatrix object
Inserting text
Saving the PDF document
Examining a PDF Library application source file
Working with Documents and Files
Opening PDF documents
Opening a PDF document in an external window
Creating a Window
Defining the parameters for an external window
Creating a handler for an external window
Displaying an open dialog box
Displaying a PDF document within a window
Bridging core API layers
Creating a PDDoc object
Creating a PDDoc object based on an open PDF document
Accessing non-PDF files
Printing documents
Creating Menus and Menu Commands
About menus
About AVmenubar typedefs
About AVMenu typedefs
About AVMenuItem typedefs
Adding menu commands to menus
Adding a menu command to an existing menu
Adding a menu command to a new menu
Creating menu callback functions
Determining if a menu item can be executed
Creating Toolbars and Buttons
About toolbars
About AVToolBar typedefs
About AVToolButton typedefs
Retrieving toolbars
Creating toolbar buttons
Setting help text for a button
Setting label text
Creating a sub-menu for a button
Retrieving existing toolbar buttons
Attaching a button to a toolbar
Exposing a button in a web browser
Removing a button from a toolbar
Creating toolbar button callback functions
Creating Annotations
About annotations
Creating text annotations
Retrieving existing annotations
Modifying text annotations
Working with Bookmarks
About bookmarks
Creating bookmarks
Defining bookmark actions
Creating a PDViewDestination object
Creating a AVPageView object
Assigning an action to a bookmark
Removing bookmark actions
Opening and closing bookmarks
Retrieving bookmarks
Retrieving the root bookmark
Retrieving a specific bookmark
Retrieving all bookmarks
Deleting bookmarks
Working with Page Views and Contents
About page coordinates
About page views
Displaying page views
Modifying page contents
Creating a PDEContent object
Accessing page contents
Determining page element types
Modifying text elements
Working with Words
About searching for words
About PDWord typedefs
About PDWordFinder typedefs
Creating a PDWordFinder object
Extracting and displaying words
Highlighting words
Creating Handlers
About handlers
Action handlers
Annotation handlers
AVCommand handlers
Creating an AVCommand handler
Invoking AVCommands
Configuring AVCommands
Setting input parameters
Setting configuration parameters
Setting AVCommand parameters
Running commands
Exposing AVCommands to the batch framework
Adding a handler to the global command list
Supporting properties
File format conversion handlers
File specification handlers
Selection servers
Tool callbacks
Window handlers
File systems
Progress monitors
Transition handlers
Adding message handling
Registering for Event Notifications
Registering event notifications
Unregistering event notifications
Working with Document Security
About document security
About security handlers
Adding a security handler
Opening a secured file
Saving a secured file
Setting security for a document
Saving a file with an encryption dictionary
Opening an encrypted file
Working with Unicode Paths
About Unicode paths
Creating Unicode file path application logic
Retrieving Unicode path values
Creating an ASFileSys object
Creating an ASFileSys object that supports Unicode paths
Working with Host Function Tables
About host function tables
Exporting host function tables
Creating HFT methods
Creating HFT method definitions
Creating HFT callback functions
Creating new Host Function Tables
Examining HFT header and source files
Examining an HFT header file
Examining an HFT source file
Importing an existing HFT
Invoking HFT methods
Replacing HFT methods
Migrating non-HFT PDF Library applications to HFT applications
Working with Cos Objects
About Cos objects
About direct and indirect objects
About Cos object types
Cos strings
Cos arrays
Cos names
Cos dictionaries
Cos streams
Working with Cos strings
Creating Cos strings
Retrieving the string value
Working with Cos arrays
Creating Cos arrays
Retrieving Cos array values
Working with Cos dictionaries
Creating Cos dictionaries
Retrieving values from a Cos dictionary
Querying a Cos dictionary for a key
Working with Cos names
Creating Cos names
Retrieving the value of a name object
Working with Cos streams
Creating Cos streams
Creating a stream dictionary
Inserting a Cos stream into a PDF document
Populating a PDF document with a content stream
Creating 3D Annotations
Creating annotations
Adding 3D data to an annotation
Creating the 3D annotation dictionary entries
Specifying the 3D stream
Creating the stream object
Adding the Cos stream to the annotation dictionary
Creating the attributes dictionary
Specifying JavaScript code
Setting the default view
Setting the annotation appearance
Setting the activation dictionary
Handling Exceptions
Creating exception handlers
Returning a value from an exception handler
Raising exceptions
Exception handling scenarios
Using goto statements
Using nested exception handlers
Using register variables
Working with Acrobat Extended APIs
About Acrobat extended APIs
Search extended API
Catalog extended API
PDF Consultant and Accessibility Checker extended API
How the consultant works
Important issues for consultant development
Importing the consultant HFTs into a plug-in
Creating and destroying consultants
Registering agents with consultants
Starting the consultant
Consultant object type identification
Creating an agent class
Creating agent constructors
Recognizing objects of interest
Post processing stage
Digital signature extended API
The PubSec layer
Digital signature components
Digital signature scenarios
Initializing the digital signature plug-in
Understanding the process
Forms extended API
Weblink extended API
Weblink services
Writing a custom driver
Spelling extended API
AcroColor extended API
PDF Optimizer API
Creating an Adobe Reader Plug-In
Enabling an Adobe Reader plug-in
Creating resource files on the Mac OS platform
Creating the public and private key pairs
Enabling the plug-in for Adobe Reader
Creating resource files on the Windows platform
Creating the public and private key pairs
Enabling the plug-in for Adobe Reader
Creating resource files on the UNIX platform
Creating the public and private keys
Enabling the plug-in for Adobe Reader
Troubleshooting
The plug-in appears to be ignored by Adobe Reader
Adobe Reader error messages
Index
bbc Developing Plug-ins and Applications April 2007 Adobe® Acrobat® SDK Version 8.1
© 2007 Adobe Systems Incorporated. All rights reserved. Adobe® Acrobat® SDK 8.1 Developing Plug-ins and Applications for Microsoft® Windows®, Mac OS®, Linux® and UNIX® Edition 2.0, April 2007 If this guide is distributed with software that includes an end user agreement, this guide, as well as the software described in it, is furnished under license and may be used or copied only in accordance with the terms of such license. Except as permitted by any such license, no part of this guide may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, recording, or otherwise, without the prior written permission of Adobe Systems Incorporated. Please note that the content in this guide is protected under copyright law even if it is not distributed with software that includes an end user license agreement. The content of this guide is furnished for informational use only, is subject to change without 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 inaccuracies that may appear in the informational content contained in this guide. Please remember that existing artwork or images that you may want to include in your project may be protected under copyright law. The unauthorized incorporation of such material into your new work could be a violation of the rights of the copyright owner. Please be sure to obtain any permission required from the copyright owner. Any references to company names and company logos in sample material are for demonstration purposes only and are not intended to refer to any actual organization. Adobe, the Adobe logo, Acrobat, LiveCycle, PostScript, and Reader are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. AIX is a trademark of International Business Machines Corporation in the United States and/or other countries. Apple and Mac OS are trademarks of Apple Computer, Inc., registered in the United States and other countries. HP-UX is a registered trademark of Hewlett-Packard Company. Intel is a registered trademark of Intel Corporation in the U.S. and other countries. JavaScript is a trademark or registered trademark of Sun Microsystems, Inc. in the United States and other countries. Linux is a registered trademark of Linus Torvalds. Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Red Hat is a trademark or registered trademark of Red Hat, Inc. in the United States and other countries. Solaris is a trademark or registered trademark of Sun Microsystems, Inc. in the United States and other countries. UNIX is a registered trademark of The Open Group in the U.S. and other countries. All other trademarks are the property of their respective owners. Adobe Systems Incorporated, 345 Park Avenue, San Jose, California 95110, USA. Notice to U.S. Government End Users. The Software and Documentation are “Commercial Items,” as that term is defined at 48 C.F.R. §2.101, consisting of “Commercial Computer Software” and “Commercial Computer Software Documentation,” as such terms are used in 48 C.F.R. §12.212 or 48 C.F.R. §227.7202, as applicable. Consistent with 48 C.F.R. §12.212 or 48 C.F.R. §§227.7202-1 through 227.7202-4, as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are being licensed to U.S. Government end users (a) only as Commercial Items and (b) with only those rights as are granted to all other end users pursuant to the terms and conditions herein. Unpublished-rights reserved under the copyright laws of the United States. Adobe Systems Incorporated, 345 Park Avenue, San Jose, CA 95110-2704, USA. For U.S. Government End Users, Adobe agrees to comply with all applicable equal opportunity laws including, if appropriate, the provisions of Executive Order 11246, as amended, Section 402 of the Vietnam Era Veterans Readjustment Assistance Act of 1974 (38 USC 4212), and Section 503 of the Rehabilitation Act of 1973, as amended, and the regulations at 41 CFR Parts 60-1 through 60-60, 60-250, and 60-741. The affirmative action clause and regulations contained in the preceding sentence shall be incorporated by reference.
Contents 1 List of Examples .........................................................................................................................11 Preface........................................................................................................................................14 What’s in this guide .....................................................................................................................................................................14 Who should read this guide? ...................................................................................................................................................14 Related documentation .............................................................................................................................................................14 Introduction ...............................................................................................................................16 About plug-ins...............................................................................................................................................................................16 About the Acrobat core API......................................................................................................................................................17 Acrobat core API objects.....................................................................................................................................................18 Acrobat core API methods..................................................................................................................................................20 Data types.................................................................................................................................................................................21 About PDF Library and plug-in applications......................................................................................................................23 Manipulating Acrobat Professional, Acrobat Standard, and Adobe Reader....................................................23 Displaying a PDF document in an external window.................................................................................................23 Indexed searching .................................................................................................................................................................24 Modifying file access.............................................................................................................................................................24 Creating new annotation types ........................................................................................................................................24 Dynamically adding text to PDF documents ...............................................................................................................24 Understanding your target application ...............................................................................................................................24 New Acrobat core APIs...............................................................................................................................................................25 2 Understanding Plug-ins ............................................................................................................27 About plug-in initialization.......................................................................................................................................................27 Plug-in loading and initialization .....................................................................................................................................28 Handshaking and Initialization .........................................................................................................................................28 Exporting HFTs........................................................................................................................................................................29 Importing HFTs and registering for notifications.......................................................................................................29 Initialization..............................................................................................................................................................................29 Unloading .................................................................................................................................................................................29 Summarizing a plug-in’s life cycle ...................................................................................................................................30 Using callback functions............................................................................................................................................................30 Notifications ...................................................................................................................................................................................31 Handling events............................................................................................................................................................................31 Mouse clicks.............................................................................................................................................................................31 Adjust cursor............................................................................................................................................................................31 Key presses ...............................................................................................................................................................................31 3
Adobe Acrobat SDK Developing Plug-ins and Applications Contents 4 2 Understanding Plug-ins (Continued) Using plug-in prefixes.................................................................................................................................................................31 Obtaining a developer prefix.............................................................................................................................................31 Using a developer prefix .....................................................................................................................................................32 Plug-in name .....................................................................................................................................................................32 Menu prefixes ...................................................................................................................................................................32 Menu items prefixes .......................................................................................................................................................32 Tool prefixes ......................................................................................................................................................................32 Toolbar button prefixes.................................................................................................................................................32 Private data prefixes .......................................................................................................................................................33 Action prefixes..................................................................................................................................................................33 Annotation prefixes ........................................................................................................................................................33 HFT prefixes .......................................................................................................................................................................33 Modifying the Acrobat or Adobe Reader user interface................................................................................................33 Adding or removing menus and menu items .............................................................................................................34 Modifying toolbars ................................................................................................................................................................34 Controlling the About box and splash screen.............................................................................................................34 Creating help files..................................................................................................................................................................34 User interface guidelines.....................................................................................................................................................34 Acquiring and releasing objects .............................................................................................................................................35 Debugging plug-ins ....................................................................................................................................................................35 Page view layers............................................................................................................................................................................36 Minimizing screen redrawing ..................................................................................................................................................36 Storing private data in PDF files..............................................................................................................................................37 Exporting data from PDF document objects .....................................................................................................................37 3 Creating Plug-in and PDF Library Applications ......................................................................39 Supported environments..........................................................................................................................................................39 Working with platform-specific techniques .......................................................................................................................40 About platform-dependent data .....................................................................................................................................40 Portability techniques ..........................................................................................................................................................40 Windows techniques ............................................................................................................................................................41 Developing a Windows plug-in..................................................................................................................................41 Locating and loading plug-ins....................................................................................................................................41 Why a plug-in might not load.....................................................................................................................................41 Macros and project settings ........................................................................................................................................42 Interapplication communication...............................................................................................................................42 Debugging.........................................................................................................................................................................42 Handling the thread local storage (TLS) limit........................................................................................................43 Using modal dialog boxes............................................................................................................................................43 Mac OS techniques................................................................................................................................................................44 Developing a Mac OS plug-in......................................................................................................................................44 Locating and loading plug-ins\ ..................................................................................................................................46 Using memory ..................................................................................................................................................................46 Resource file considerations........................................................................................................................................46 Mac OS-only methods....................................................................................................................................................47 Interapplication communication...............................................................................................................................47
Adobe Acrobat SDK Developing Plug-ins and Applications Contents 5 3 Creating Plug-in and PDF Library Applications (Continued) 4 Creating a sample plug-in.........................................................................................................................................................47 Including Acrobat SDK library files ..................................................................................................................................48 Adding the PIMain source file ...........................................................................................................................................53 Adding application logic.....................................................................................................................................................53 Compiling and building your plug-in.............................................................................................................................53 Creating a sample PDF Library application.........................................................................................................................54 Contents of the PDF Library SDK......................................................................................................................................54 Including library files ......................................................................................................................................................54 Sample code......................................................................................................................................................................55 Developing applications with the Adobe PDF Library.............................................................................................56 Windows .............................................................................................................................................................................57 Mac OS.................................................................................................................................................................................57 UNIX......................................................................................................................................................................................57 Initialization and termination............................................................................................................................................58 Multithreading ........................................................................................................................................................................59 Upgrading existing plug-ins.....................................................................................................................................................59 Detecting supported APIs...................................................................................................................................................59 Updates to ASCoord and AVRect .....................................................................................................................................60 Upgrading plug-ins in Windows.......................................................................................................................................60 Upgrading plug-ins on Mac OS.........................................................................................................................................61 Migrating a PDF Library application from CodeWarrior to Xcode..............................................................................61 Inserting Text into PDF Documents .........................................................................................62 About inserting text into a PDF document.........................................................................................................................62 Creating a new PDF document.........................................................................................................................................63 Creating a new page.............................................................................................................................................................63 Creating a container .............................................................................................................................................................63 Acquiring fonts .......................................................................................................................................................................64 Creating a PDEGraphicState object.................................................................................................................................65 Creating an ASFixedMatrix object ...................................................................................................................................65 Inserting text............................................................................................................................................................................65 Saving the PDF document..................................................................................................................................................67 Examining a PDF Library application source file...............................................................................................................67 5 Working with Documents and Files .........................................................................................72 Opening PDF documents..........................................................................................................................................................72 Opening a PDF document in an external window...........................................................................................................74 Creating a Window................................................................................................................................................................75 Defining the parameters for an external window......................................................................................................75 Creating a handler for an external window..................................................................................................................76 Displaying an open dialog box .........................................................................................................................................76 Displaying a PDF document within a window ............................................................................................................79 Bridging core API layers .............................................................................................................................................................83 Creating a PDDoc object .....................................................................................................................................................83 Creating a PDDoc object based on an open PDF document.................................................................................84 Accessing non-PDF files.......................................................................................................................................................85 Printing documents.....................................................................................................................................................................87
Adobe Acrobat SDK Developing Plug-ins and Applications Contents 6 6 Creating Menus and Menu Commands....................................................................................88 About menus .................................................................................................................................................................................88 About AVmenubar typedefs..............................................................................................................................................89 About AVMenu typedefs.....................................................................................................................................................89 About AVMenuItem typedefs............................................................................................................................................89 Adding menu commands to menus .....................................................................................................................................90 Adding a menu command to an existing menu.........................................................................................................91 Adding a menu command to a new menu ..................................................................................................................92 Creating menu callback functions .........................................................................................................................................93 Determining if a menu item can be executed ...................................................................................................................96 7 Creating Toolbars and Buttons ................................................................................................97 About toolbars ..............................................................................................................................................................................97 About AVToolBar typedefs .................................................................................................................................................98 About AVToolButton typedefs..........................................................................................................................................98 Retrieving toolbars ......................................................................................................................................................................98 Creating toolbar buttons........................................................................................................................................................ 100 Setting help text for a button......................................................................................................................................... 101 Setting label text ................................................................................................................................................................. 101 Creating a sub-menu for a button ................................................................................................................................ 102 Retrieving existing toolbar buttons.................................................................................................................................... 102 Attaching a button to a toolbar ........................................................................................................................................... 103 Exposing a button in a web browser.................................................................................................................................. 104 Removing a button from a toolbar..................................................................................................................................... 105 Creating toolbar button callback functions..................................................................................................................... 105 8 Creating Annotations..............................................................................................................108 About annotations.................................................................................................................................................................... 108 Creating text annotations ...................................................................................................................................................... 108 Retrieving existing annotations........................................................................................................................................... 110 Modifying text annotations................................................................................................................................................... 111 9 Working with Bookmarks .......................................................................................................113 About bookmarks...................................................................................................................................................................... 113 Creating bookmarks................................................................................................................................................................. 114 Defining bookmark actions............................................................................................................................................. 115 Creating a PDViewDestination object................................................................................................................... 115 Creating a AVPageView object ................................................................................................................................ 116 Assigning an action to a bookmark ....................................................................................................................... 116 Removing bookmark actions.......................................................................................................................................... 117 Opening and closing bookmarks.................................................................................................................................. 117 Retrieving bookmarks.............................................................................................................................................................. 118 Retrieving the root bookmark........................................................................................................................................ 118 Retrieving a specific bookmark...................................................................................................................................... 118 Retrieving all bookmarks.................................................................................................................................................. 119 Deleting bookmarks................................................................................................................................................................. 120
Adobe Acrobat SDK Developing Plug-ins and Applications Contents 7 10 Working with Page Views and Contents................................................................................122 About page coordinates......................................................................................................................................................... 122 About page views ..................................................................................................................................................................... 124 Displaying page views............................................................................................................................................................. 124 Modifying page contents ....................................................................................................................................................... 125 Creating a PDEContent object ....................................................................................................................................... 125 Accessing page contents ................................................................................................................................................. 126 Determining page element types................................................................................................................................. 127 Modifying text elements .................................................................................................................................................. 128 11 Working with Words................................................................................................................131 About searching for words .................................................................................................................................................... 131 About PDWord typedefs .................................................................................................................................................. 131 About PDWordFinder typedefs ..................................................................................................................................... 132 Creating a PDWordFinder object......................................................................................................................................... 132 Extracting and displaying words ......................................................................................................................................... 134 Highlighting words................................................................................................................................................................... 136 12 Creating Handlers....................................................................................................................138 About handlers........................................................................................................................................................................... 138 Action handlers.......................................................................................................................................................................... 139 Annotation handlers ................................................................................................................................................................ 140 AVCommand handlers ............................................................................................................................................................ 140 Creating an AVCommand handler................................................................................................................................ 140 Invoking AVCommands.................................................................................................................................................... 141 Configuring AVCommands ............................................................................................................................................. 141 Setting input parameters........................................................................................................................................... 141 Setting configuration parameters .......................................................................................................................... 142 Setting AVCommand parameters........................................................................................................................... 142 Running commands........................................................................................................................................................... 143 Exposing AVCommands to the batch framework................................................................................................... 144 Adding a handler to the global command list................................................................................................... 144 Supporting properties ................................................................................................................................................ 144 File format conversion handlers .......................................................................................................................................... 145 File specification handlers...................................................................................................................................................... 146 Selection servers........................................................................................................................................................................ 146 Tool callbacks.............................................................................................................................................................................. 147 Window handlers ...................................................................................................................................................................... 147 File systems.................................................................................................................................................................................. 148 Progress monitors ..................................................................................................................................................................... 149 Transition handlers ................................................................................................................................................................... 149 Adding message handling..................................................................................................................................................... 150 13 Registering for Event Notifications........................................................................................151 Registering event notifications ............................................................................................................................................ 151 Unregistering event notifications ....................................................................................................................................... 153
Adobe Acrobat SDK Developing Plug-ins and Applications Contents 8 14 Working with Document Security ..........................................................................................154 About document security ...................................................................................................................................................... 154 About security handlers.......................................................................................................................................................... 154 Adding a security handler................................................................................................................................................ 155 Opening a secured file ...................................................................................................................................................... 157 Saving a secured file .......................................................................................................................................................... 158 Setting security for a document .......................................................................................................................................... 159 Saving a file with an encryption dictionary............................................................................................................... 159 Opening an encrypted file............................................................................................................................................... 159 15 Working with Unicode Paths ..................................................................................................160 About Unicode paths............................................................................................................................................................... 160 Creating Unicode file path application logic................................................................................................................... 160 Retrieving Unicode path values........................................................................................................................................... 161 Creating an ASFileSys object .......................................................................................................................................... 162 Creating an ASFileSys object that supports Unicode paths................................................................................ 163 16 Working with Host Function Tables.......................................................................................164 About host function tables.................................................................................................................................................... 164 Exporting host function tables............................................................................................................................................. 165 Creating HFT methods ...................................................................................................................................................... 166 Creating HFT method definitions.................................................................................................................................. 166 Creating HFT callback functions.................................................................................................................................... 168 Creating new Host Function Tables ............................................................................................................................. 169 Examining HFT header and source files...................................................................................................................... 170 Examining an HFT header file .................................................................................................................................. 170 Examining an HFT source file ................................................................................................................................... 171 Importing an existing HFT...................................................................................................................................................... 173 Invoking HFT methods ............................................................................................................................................................ 174 Replacing HFT methods.......................................................................................................................................................... 174 Migrating non-HFT PDF Library applications to HFT applications.......................................................................... 176 17 Working with Cos Objects.......................................................................................................178 About Cos objects..................................................................................................................................................................... 178 About direct and indirect objects ................................................................................................................................. 179 About Cos object types..................................................................................................................................................... 179 Cos strings ....................................................................................................................................................................... 179 Cos arrays......................................................................................................................................................................... 181 Cos names ....................................................................................................................................................................... 181 Cos dictionaries ............................................................................................................................................................. 182 Cos streams..................................................................................................................................................................... 183 Working with Cos strings........................................................................................................................................................ 183 Creating Cos strings ........................................................................................................................................................... 183 Retrieving the string value............................................................................................................................................... 184 Working with Cos arrays ......................................................................................................................................................... 184 Creating Cos arrays............................................................................................................................................................. 184 Retrieving Cos array values ............................................................................................................................................. 185 Working with Cos dictionaries.............................................................................................................................................. 186 Creating Cos dictionaries ................................................................................................................................................. 186 Retrieving values from a Cos dictionary ..................................................................................................................... 187 Querying a Cos dictionary for a key.............................................................................................................................. 188
分享到:
收藏