bbc JavaScript for Acrobat API Reference ™ ® Adobe Acrobat SDK ® ® April 2007 Version 8.1 © 2007 Adobe Systems Incorporated. All rights reserved. Adobe® Acrobat® SDK 8.1 JavaScript for Acrobat API Reference for Microsoft® Windows® and Mac OS®. 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, company logos and user names in sample material or sample forms included in this documentation and/or software are for demonstration purposes only and are not intended to refer to any actual organization or persons. Adobe, the Adobe logo, Acrobat, Distiller, FrameMaker, LiveCycle, PostScript and Reader are either registered trademarks or trademarks of Adobe Systems Incorporated 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. JavaScript is a trademark or registered trademark of Sun Microsystems, Inc. in the United States and other countries. Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or 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 Preface........................................................................................................................................28 What’s in this guide?...................................................................................................................................................................28 Who should read this guide?...................................................................................................................................................28 Related documentation.............................................................................................................................................................28 1 Introduction...............................................................................................................................30 Syntax...............................................................................................................................................................................................30 Paths..................................................................................................................................................................................................31 Safe path..........................................................................................................................................................................................31 Privileged context........................................................................................................................................................................31 Privileged versus non-privileged context...........................................................................................................................32 User preferences...........................................................................................................................................................................32 Quick bars........................................................................................................................................................................................33 Domain names in code samples.............................................................................................................................................34 2 JavaScript API............................................................................................................................35 ADBC.................................................................................................................................................................................................36 ADBC properties.....................................................................................................................................................................36 SQL types............................................................................................................................................................................36 JavaScript types................................................................................................................................................................37 ADBC methods........................................................................................................................................................................38 getDataSourceList...........................................................................................................................................................38 newConnection................................................................................................................................................................38 Alerter...............................................................................................................................................................................................40 Alerter methods......................................................................................................................................................................40 dispatch...............................................................................................................................................................................40 AlternatePresentation................................................................................................................................................................43 AlternatePresentation properties....................................................................................................................................43 active....................................................................................................................................................................................43 type.......................................................................................................................................................................................43 AlternatePresentation methods.......................................................................................................................................44 start.......................................................................................................................................................................................44 stop.......................................................................................................................................................................................44 Annotation......................................................................................................................................................................................45 Annotation types...................................................................................................................................................................45 Annotation properties..........................................................................................................................................................47 alignment...........................................................................................................................................................................47 AP..........................................................................................................................................................................................48 arrowBegin.........................................................................................................................................................................49 arrowEnd.............................................................................................................................................................................50 attachIcon...........................................................................................................................................................................50 author...................................................................................................................................................................................51 borderEffectIntensity.....................................................................................................................................................51 borderEffectStyle.............................................................................................................................................................52 callout..................................................................................................................................................................................52 caretSymbol.......................................................................................................................................................................52 3 Adobe Acrobat SDK Contents JavaScript for Acrobat API Reference 4 2 JavaScript API (Continued) Annotation (Continued) Annotation properties (Continued) contents..............................................................................................................................................................................53 creationDate......................................................................................................................................................................53 dash......................................................................................................................................................................................54 delay.....................................................................................................................................................................................54 doc........................................................................................................................................................................................55 doCaption...........................................................................................................................................................................56 fillColor................................................................................................................................................................................56 gestures...............................................................................................................................................................................57 hidden..................................................................................................................................................................................57 inReplyTo............................................................................................................................................................................58 intent....................................................................................................................................................................................58 leaderExtend.....................................................................................................................................................................59 leaderLength.....................................................................................................................................................................59 lineEnding..........................................................................................................................................................................60 lock........................................................................................................................................................................................60 modDate.............................................................................................................................................................................61 name.....................................................................................................................................................................................61 noteIcon..............................................................................................................................................................................62 noView.................................................................................................................................................................................63 opacity.................................................................................................................................................................................63 page......................................................................................................................................................................................64 point.....................................................................................................................................................................................64 points...................................................................................................................................................................................65 popupOpen.......................................................................................................................................................................66 popupRect..........................................................................................................................................................................66 print......................................................................................................................................................................................67 quads....................................................................................................................................................................................67 rect........................................................................................................................................................................................68 readOnly..............................................................................................................................................................................68 refType.................................................................................................................................................................................68 richContents......................................................................................................................................................................69 richDefaults........................................................................................................................................................................70 rotate....................................................................................................................................................................................70 seqNum...............................................................................................................................................................................71 soundIcon...........................................................................................................................................................................71 state......................................................................................................................................................................................72 stateModel.........................................................................................................................................................................72 strokeColor.........................................................................................................................................................................72 style.......................................................................................................................................................................................73 subject.................................................................................................................................................................................73 textFont...............................................................................................................................................................................74 textSize................................................................................................................................................................................75 toggleNoView...................................................................................................................................................................75 type.......................................................................................................................................................................................76 vertices................................................................................................................................................................................76 width....................................................................................................................................................................................77 Adobe Acrobat SDK Contents JavaScript for Acrobat API Reference 5 2 JavaScript API (Continued) Annotation (Continued) Annotation methods............................................................................................................................................................77 destroy.................................................................................................................................................................................77 getProps..............................................................................................................................................................................78 getStateInModel..............................................................................................................................................................79 setProps...............................................................................................................................................................................79 transitionToState.............................................................................................................................................................80 Annot3D..........................................................................................................................................................................................82 Annot3D properties..............................................................................................................................................................82 activated.............................................................................................................................................................................82 context3D...........................................................................................................................................................................82 innerRect.............................................................................................................................................................................83 name.....................................................................................................................................................................................83 page......................................................................................................................................................................................83 rect........................................................................................................................................................................................84 app.....................................................................................................................................................................................................85 app properties.........................................................................................................................................................................85 activeDocs..........................................................................................................................................................................85 calculate..............................................................................................................................................................................86 constants............................................................................................................................................................................86 focusRect............................................................................................................................................................................87 formsVersion.....................................................................................................................................................................87 fromPDFConverters........................................................................................................................................................88 fs.............................................................................................................................................................................................88 fullscreen............................................................................................................................................................................89 language.............................................................................................................................................................................89 media...................................................................................................................................................................................90 monitors..............................................................................................................................................................................90 numPlugIns........................................................................................................................................................................91 openInPlace.......................................................................................................................................................................91 platform...............................................................................................................................................................................92 plugIns.................................................................................................................................................................................92 printColorProfiles.............................................................................................................................................................93 printerNames....................................................................................................................................................................93 runtimeHighlight.............................................................................................................................................................94 runtimeHighlightColor..................................................................................................................................................94 thermometer.....................................................................................................................................................................94 toolbar.................................................................................................................................................................................95 toolbarHorizontal............................................................................................................................................................95 toolbarVertical..................................................................................................................................................................96 viewerType.........................................................................................................................................................................96 viewerVariation................................................................................................................................................................97 viewerVersion....................................................................................................................................................................97 app methods...........................................................................................................................................................................97 addMenuItem...................................................................................................................................................................97 addSubMenu.....................................................................................................................................................................99 addToolButton...............................................................................................................................................................100 alert....................................................................................................................................................................................101 beep...................................................................................................................................................................................103 beginPriv..........................................................................................................................................................................104 Adobe Acrobat SDK Contents JavaScript for Acrobat API Reference 6 2 JavaScript API (Continued) app (Continued) app methods (Continued) browseForDoc................................................................................................................................................................104 clearInterval....................................................................................................................................................................106 clearTimeOut..................................................................................................................................................................106 endPriv..............................................................................................................................................................................106 execDialog.......................................................................................................................................................................107 execMenuItem...............................................................................................................................................................120 getNthPlugInName......................................................................................................................................................124 getPath.............................................................................................................................................................................124 goBack..............................................................................................................................................................................125 goForward.......................................................................................................................................................................125 hideMenuItem...............................................................................................................................................................126 hideToolbarButton.......................................................................................................................................................126 launchURL.......................................................................................................................................................................127 listMenuItems................................................................................................................................................................127 listToolbarButtons........................................................................................................................................................128 mailGetAddrs.................................................................................................................................................................129 mailMsg............................................................................................................................................................................130 newDoc............................................................................................................................................................................131 newFDF............................................................................................................................................................................133 openDoc..........................................................................................................................................................................133 openFDF...........................................................................................................................................................................136 popUpMenu...................................................................................................................................................................136 popUpMenuEx...............................................................................................................................................................137 removeToolButton.......................................................................................................................................................139 response...........................................................................................................................................................................139 setInterval........................................................................................................................................................................140 setTimeOut......................................................................................................................................................................141 trustedFunction.............................................................................................................................................................143 trustPropagatorFunction...........................................................................................................................................146 app.media....................................................................................................................................................................................150 app.media properties........................................................................................................................................................150 align...................................................................................................................................................................................150 canResize.........................................................................................................................................................................151 closeReason....................................................................................................................................................................151 defaultVisible..................................................................................................................................................................152 ifOffScreen.......................................................................................................................................................................152 layout................................................................................................................................................................................153 monitorType...................................................................................................................................................................153 openCode........................................................................................................................................................................154 over....................................................................................................................................................................................155 pageEventNames..........................................................................................................................................................155 raiseCode.........................................................................................................................................................................156 raiseSystem.....................................................................................................................................................................156 renditionType.................................................................................................................................................................157 status.................................................................................................................................................................................157 trace...................................................................................................................................................................................158 version..............................................................................................................................................................................158 windowType...................................................................................................................................................................159 Adobe Acrobat SDK Contents JavaScript for Acrobat API Reference 7 2 JavaScript API (Continued) app.media (Continued) app.media methods...........................................................................................................................................................159 addStockEvents.............................................................................................................................................................159 alertFileNotFound........................................................................................................................................................160 alertSelectFailed............................................................................................................................................................160 argsDWIM........................................................................................................................................................................161 canPlayOrAlert...............................................................................................................................................................161 computeFloatWinRect................................................................................................................................................162 constrainRectToScreen...............................................................................................................................................163 createPlayer....................................................................................................................................................................163 getAltTextData..............................................................................................................................................................165 getAltTextSettings........................................................................................................................................................166 getAnnotStockEvents.................................................................................................................................................167 getAnnotTraceEvents..................................................................................................................................................167 getPlayers........................................................................................................................................................................167 getPlayerStockEvents..................................................................................................................................................168 getPlayerTraceEvents..................................................................................................................................................169 getRenditionSettings..................................................................................................................................................169 getURLData.....................................................................................................................................................................169 getURLSettings..............................................................................................................................................................170 getWindowBorderSize................................................................................................................................................172 openPlayer......................................................................................................................................................................172 removeStockEvents.....................................................................................................................................................174 startPlayer........................................................................................................................................................................174 Bookmark.....................................................................................................................................................................................175 Bookmark properties.........................................................................................................................................................175 children............................................................................................................................................................................175 color...................................................................................................................................................................................175 doc.....................................................................................................................................................................................176 name..................................................................................................................................................................................176 open...................................................................................................................................................................................177 parent................................................................................................................................................................................177 style....................................................................................................................................................................................177 Bookmark methods............................................................................................................................................................178 createChild......................................................................................................................................................................178 execute.............................................................................................................................................................................178 insertChild.......................................................................................................................................................................179 remove..............................................................................................................................................................................180 setAction..........................................................................................................................................................................180 catalog...........................................................................................................................................................................................181 catalog properties...............................................................................................................................................................181 isIdle...................................................................................................................................................................................181 jobs.....................................................................................................................................................................................181 catalog methods.................................................................................................................................................................182 getIndex...........................................................................................................................................................................182 remove..............................................................................................................................................................................182 CatalogJob...................................................................................................................................................................................183 CatalogJob properties.......................................................................................................................................................183 path....................................................................................................................................................................................183 type....................................................................................................................................................................................183 status.................................................................................................................................................................................183 Adobe Acrobat SDK Contents JavaScript for Acrobat API Reference 8 2 JavaScript API (Continued) Certificate.....................................................................................................................................................................................184 Certificate properties.........................................................................................................................................................184 binary................................................................................................................................................................................184 issuerDN...........................................................................................................................................................................184 keyUsage..........................................................................................................................................................................185 MD5Hash.........................................................................................................................................................................185 privateKeyValidityEnd.................................................................................................................................................185 privateKeyValidityStart...............................................................................................................................................186 SHA1Hash........................................................................................................................................................................186 serialNumber..................................................................................................................................................................186 subjectCN........................................................................................................................................................................187 subjectDN........................................................................................................................................................................187 ubRights...........................................................................................................................................................................187 usage.................................................................................................................................................................................188 validityEnd.......................................................................................................................................................................190 validityStart.....................................................................................................................................................................190 Collab.............................................................................................................................................................................................191 Collab methods...................................................................................................................................................................191 addStateModel..............................................................................................................................................................191 documentToStream.....................................................................................................................................................192 removeStateModel......................................................................................................................................................192 color...............................................................................................................................................................................................193 Color arrays...........................................................................................................................................................................193 color properties...................................................................................................................................................................193 color methods......................................................................................................................................................................194 convert..............................................................................................................................................................................194 equal..................................................................................................................................................................................195 colorConvertAction..................................................................................................................................................................196 colorConvertAction properties......................................................................................................................................196 action................................................................................................................................................................................196 alias....................................................................................................................................................................................196 colorantName................................................................................................................................................................197 convertIntent.................................................................................................................................................................197 convertProfile.................................................................................................................................................................198 embed...............................................................................................................................................................................198 isProcessColor................................................................................................................................................................198 matchAttributesAll.......................................................................................................................................................199 matchAttributesAny....................................................................................................................................................200 matchIntent....................................................................................................................................................................200 matchSpaceTypeAll.....................................................................................................................................................201 matchSpaceTypeAny..................................................................................................................................................202 preserveBlack.................................................................................................................................................................202 useBlackPointCompensation...................................................................................................................................203 Column..........................................................................................................................................................................................204 Column properties..............................................................................................................................................................204 columnNum....................................................................................................................................................................204 name..................................................................................................................................................................................204 type....................................................................................................................................................................................204 typeName........................................................................................................................................................................205 value..................................................................................................................................................................................205 Adobe Acrobat SDK Contents JavaScript for Acrobat API Reference 9 2 JavaScript API (Continued) ColumnInfo..................................................................................................................................................................................206 ColumnInfo properties......................................................................................................................................................206 name..................................................................................................................................................................................206 description......................................................................................................................................................................206 type....................................................................................................................................................................................206 typeName........................................................................................................................................................................207 Connection..................................................................................................................................................................................208 Connection methods.........................................................................................................................................................208 close...................................................................................................................................................................................208 getColumnList...............................................................................................................................................................208 getTableList....................................................................................................................................................................209 newStatement...............................................................................................................................................................209 console..........................................................................................................................................................................................210 console methods.................................................................................................................................................................210 clear...................................................................................................................................................................................210 hide....................................................................................................................................................................................210 println...............................................................................................................................................................................210 show..................................................................................................................................................................................211 Data................................................................................................................................................................................................212 Data properties....................................................................................................................................................................212 creationDate...................................................................................................................................................................212 description......................................................................................................................................................................212 MIMEType........................................................................................................................................................................213 modDate..........................................................................................................................................................................213 name..................................................................................................................................................................................213 path....................................................................................................................................................................................214 size.....................................................................................................................................................................................214 DataSourceInfo..........................................................................................................................................................................215 DataSourceInfo properties..............................................................................................................................................215 name..................................................................................................................................................................................215 description......................................................................................................................................................................215 dbg..................................................................................................................................................................................................216 dbg properties.....................................................................................................................................................................216 bps......................................................................................................................................................................................216 dbg methods........................................................................................................................................................................217 c...........................................................................................................................................................................................217 cb........................................................................................................................................................................................217 q..........................................................................................................................................................................................217 sb........................................................................................................................................................................................218 si..........................................................................................................................................................................................219 sn........................................................................................................................................................................................219 so........................................................................................................................................................................................219 sv.........................................................................................................................................................................................219 Dialog.............................................................................................................................................................................................220 Dialog methods...................................................................................................................................................................220 enable...............................................................................................................................................................................220 end.....................................................................................................................................................................................220 load....................................................................................................................................................................................221 store...................................................................................................................................................................................221 Adobe Acrobat SDK Contents JavaScript for Acrobat API Reference 10 2 JavaScript API (Continued) DirConnection............................................................................................................................................................................222 DirConnection properties................................................................................................................................................222 canList...............................................................................................................................................................................222 canDoCustomSearch...................................................................................................................................................222 canDoCustomUISearch..............................................................................................................................................223 canDoStandardSearch................................................................................................................................................223 groups...............................................................................................................................................................................224 name..................................................................................................................................................................................224 uiName.............................................................................................................................................................................224 DirConnection methods...................................................................................................................................................225 search................................................................................................................................................................................225 setOutputFields.............................................................................................................................................................226 Directory.......................................................................................................................................................................................228 Directory properties...........................................................................................................................................................228 info.....................................................................................................................................................................................228 Directory methods..............................................................................................................................................................230 connect.............................................................................................................................................................................230 Doc..................................................................................................................................................................................................232 Doc properties.....................................................................................................................................................................233 alternatePresentations...............................................................................................................................................233 author................................................................................................................................................................................234 baseURL............................................................................................................................................................................234 bookmarkRoot...............................................................................................................................................................234 calculate...........................................................................................................................................................................235 creationDate...................................................................................................................................................................235 creator...............................................................................................................................................................................236 dataObjects.....................................................................................................................................................................236 delay..................................................................................................................................................................................237 dirty....................................................................................................................................................................................237 disclosed..........................................................................................................................................................................238 docID.................................................................................................................................................................................239 documentFileName.....................................................................................................................................................239 dynamicXFAForm.........................................................................................................................................................240 external.............................................................................................................................................................................240 filesize...............................................................................................................................................................................241 hidden...............................................................................................................................................................................241 hostContainer................................................................................................................................................................242 icons..................................................................................................................................................................................242 info.....................................................................................................................................................................................243 innerAppWindowRect................................................................................................................................................244 innerDocWindowRect.................................................................................................................................................245 isModal.............................................................................................................................................................................245 keywords..........................................................................................................................................................................245 layout................................................................................................................................................................................246 media................................................................................................................................................................................246 metadata..........................................................................................................................................................................247 modDate..........................................................................................................................................................................248 mouseX.............................................................................................................................................................................249 mouseY.............................................................................................................................................................................249 noautocomplete...........................................................................................................................................................250
Description: