INTERNATIONAL ISO STANDARD 21757-1

First edition

Document management — ECMAScript for PDF — Part 1:

Use of ISO 32000-2 (PDF0- 2.0) W e8 IE -2 V 07 E a3 ) 4 R i 68 P .a /5 -1 D h st 7 e si 75 R it s/ 1 A s. : d -2 rd r rf D rd a da p N a d n o- A d an ta is t /s / T n l s g 5 S ta l lo 8 s u a cc eh ( F at 0 /c fa iT ai c . b0 eh a it - s. 43 rd a9 a 1- nd f a 4b st // s: tp ht

PROOF/ÉPREUVE

Reference number ISO 21757-1:2020(E)

© ISO 2020 ISO 21757-1:2020(E) 

0- W e8 IE -2 V 07 E a3 ) 4 R i 68 P .a /5 -1 D h st 7 e si 75 R it s/ 1 A s. : d -2 rd r rf D rd a da p N a d n o- A d an ta is t /s c/ T n l s g 5 S ta l lo 8 s u a cc eh ( F at 0 /c fa iT ai c . b0 eh a it - s. 43 rd a9 a 1- nd f a 4b st // s: tp ht

COPYRIGHT PROTECTED DOCUMENT

© ISO 2020

All rights reserved. Unless otherwise specified, or required in the context of its implementation, no part of this publication may be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address belowCP 401or ISO’s • Ch. member de Blandonnet body in 8 the country of the requester. ISO copyright office Phone: +41 22 749 01 11 CH-1214 Vernier, Geneva Website: www.iso.org PublishedEmail: [email protected] Switzerland

ii PROOF/ÉPREUVE © ISO 2020 – All rights reserved ISO 21757-1:2020(E) 

Contents Page

Foreword...... ix Introduction...... x 1 ...... 1 2 Normative references...... 1 3 Terms and definitions...... 1 4 Notation...... 1 5 Syntax...... 2 ...... 2 5.2 Method arguments...... 2 5.1 General 6 Paths...... 2 7 Safe path...... 2 8 Privileged context...... 3 9 Privileged versus non-privileged context...... 3 0- 10 ECMAScript API...... W e8 3 IE -2 ...... V 07 3 E a3 10.2 Annotation...... ) 4 3 R i 68 10.1 General ...... P .a /5 -1 3 D h st 7 ...... e si 75 R it s/ 1 4 A s. : d -2 10.2.110.2.3 GeneralAnnotation properties...... rd r rf 5 D rd a da p 10.2.210.2.4 Annotation typesmethodsN .a...... d n o- 13 A d an ta is t /s c/ T n ...... l s g 5 15 S ta l lo 8 10.3 AnnotRichMedia...... s u a cc 17 eh ( F at 0 /c fa 10.2.5 Annotation...... iT examples ai c 17 . b0 10.3.2 AnnotRichMedia propertieseh a ...... 17 it - . 43 10.4 Annot3D10.3.1 General...... ds 9 17 r -a ...... da 1 n bf 17 ta 4 10.4.2 Annot3D properties/s ...... 17 :/ 10.5 app10.4.1...... General ps 18 tt ...... h 18 10.5.2 app properties...... 18 10.5.110.5.3 Generalapp methods...... 20 10.6 Bookmark...... 30 ...... 30 10.6.2 Bookmark properties...... 30 10.6.110.6.3 GeneralBookmark methods...... 31 ...... 32 ...... 33 10.6.4 Bookmark...... Examples 33 10.7 Certificate ...... 34 10.8 color10.7.1...... General 36 10.7.2 Certificate...... properties 36 ...... 36 10.8.110.8.3 Generalcolor properties...... 36 10.8.210.8.4 color arraysmethods...... 37 10.9 collection...... 38 ...... 38 10.9.2 collection properties...... 38 10.9.110.9.3 Generalcollection methods...... 38 10.10 collectionField...... 40 ...... 40

10.10.1 General © ISO 2020 – All rights reserved PROOF/ÉPREUVE iii ISO 21757-1:2020(E) 

10.10.2 collectionField properties...... 40 10.11 Data...... 41 ...... 41 10.11.2 Data properties...... 42 10.11.110.11.3 GeneralData methods...... 42 10.12 Dialog...... 43 ...... 43 10.12.2 Dialog methods...... 43 10.13 Doc10.12.1...... General 44 ...... 44 10.13.2 Doc properties...... 45 10.13.110.13.3 GeneralDoc methods...... 49 10.14 Embedded PDF...... 89 ...... 89 10.14.2 Embedded PDF properties...... 90 10.14.110.14.3 GeneralEmbedded PDF methods...... 91 10.15 Error...... 91 ...... 91 10.15.2 Error properties...... 92 10.15.110.15.3 GeneralError methods...... 92 10.16 event...... 93 0- ...... W e8 93 IE -2 ...... V 07 93 E a3 10.16.110.16.3 GeneralDocument Event Processing...... ) 4 99 R i 68 10.16.210.16.4 EventForm eventtype/name processing combinations...... P .a /5 -1 99 D h st 7 e si 75 10.16.5 event properties...... R it s/ 1 100 A s. : d -2 10.17 Field...... rd r rf 105 D rd a da p ...... N a d n o- A d an ta is 105 t /s c/ 10.17.2 Field versus widget attributesT n ...... l s g 5 106 S ta l lo 8 s u a cc 10.17.110.17.3 GeneralField properties...... eh ( F at 0 106 /c fa 10.17.4 Field methods...... iT ai c 118 . b0 eh a 10.18 FullScreen...... it - 135 . 43 ...... ds 9 135 r -a da 1 10.18.2 FullScreen propertiesn...... bf 135 ta 4 10.19 global10.18.1...... General /s 136 :/ ...... ps 136 tt 10.19.2 Creating globalh properties...... 136 10.19.110.19.3 GeneralDeleting global properties...... 137 ...... 137 ...... 137 10.20 HostContainer10.19.4 Global...... object security policy 138 10.19.5 global object...... methods 138 10.20.2 HostContainer properties...... 139 10.20.110.20.3 GeneralHostContainer methods...... 140 10.21 Icon...... 141 ...... 141 10.21.2 icon Properties...... 141 10.22 Link10.21.1...... General 141 ...... 141 10.22.2 Link properties...... 141 10.22.110.22.3 GeneralLink methods...... 142 10.23 Net...... 142 ...... 142 10.23.2 Net properties...... 142 10.23.110.23.3 GeneralNet methods...... 144 ...... 146 ...... 146 10.24 OCG ...... 146 10.24.1 General 10.24.2 OCG properties iv PROOF/ÉPREUVE © ISO 2020 – All rights reserved ISO 21757-1:2020(E) 

...... 147 10.25 PrintParams...... 148 10.24.3 OCG methods...... 148 10.25.2 PrintParams properties...... 148 10.26 RDN10.25.1...... General 151 ...... 151 10.26.2 RDN properties...... 152 10.27 ReadStream10.26.1 General...... 152 ...... 152 10.27.2 ReadStream methods...... 152 10.27.1 ...... General 153 ...... 153 10.28 security ...... 153 10.28.1 General ...... 153 10.28.2 security constants...... 154 10.28.3 security...... Properties 157 10.28.4 security...... Methods 157 10.29 SecurityHandler ...... 157 10.29.1 General ...... 160 10.29.2 SecurityHandler...... properties 163 ...... 163 10.29.3 SecurityHandler methods 0- 10.30 SecurityPolicy ...... W e8 163 IE -2 10.31 SignatureInfo10.30.1 General...... V 07 163 E a3 10.30.2 SecurityPolicy...... properties ) 4 163 R i 68 10.31.2 SignatureInfo Base properties P .a...... /5 -1 163 D h st 7 e si 75 10.31.1 General R it s/ 1 ...... 165 A s. : d -2 rd r rf ...... 168 D rd a da p ...... N a d n o- 10.32 SOAP10.31.3 SignatureInfo objectA d publican keyta securityis handler properties 168 t /s c/ 10.31.4 Modification...... DetectionT n andl s Preventiong 5 (MDP) Values 168 S ta l lo 8 s u a cc 10.32.2 SOAP propertieseh ( ...... F at 0 169 /c fa 10.32.110.32.3 GeneralSOAP methodsiT ...... ai c 169 . b0 eh a 10.33 Span...... it - 181 . 43 ...... ds 9 181 r -a da 1 10.33.2 Span propertiesn ...... bf 181 ta 4 10.34 Template10.33.1 General...... /s 183 :/ ...... ps 183 tt 10.34.2 Templateh properties...... 183 10.34.110.34.3 GeneralTemplate methods...... 183 10.35 Thermometer...... 184 ...... 184 10.35.2 Thermometer properties...... 184 10.35.110.35.3 GeneralThermometer methods...... 185 10.36 this...... 185 ...... 185 ...... 186 10.37 util10.36.1...... General 186 10.36.2 Variable...... and function name conflicts 186 10.37.2 util methods...... 186 10.37.1 General 11 ECMAScript 3D API...... 193 ...... 193 ...... 193 11.1 General ...... 193 11.1.1 Basic Objects ...... 193 11.1.2 Scene object ...... 194 11.1.3 Canvas object ...... 194 11.2 Event11.1.4 handlersRuntime...... object 194 11.1.5 Resource...... objects 194 11.2.2 CameraEvent...... 194 11.2.1 General © ISO 2020 – All rights reserved PROOF/ÉPREUVE v ISO 21757-1:2020(E) 

...... 194 11.2.4 MouseEvent...... 194 11.2.311.2.5 KeyEventRenderEvent...... 195 11.2.6 ScrollWheelEvent...... 195 11.2.7 SelectionEvent...... 195 11.2.8 TimeEvent...... 195 11.2.9 ToolEvent...... 195 12 Object overview...... 196 ...... 196 12.2 Animation...... 196 12.1 General ...... 196 12.2.2 Animation properties...... 196 12.3 Background12.2.1 General...... 196 ...... 196 ...... 196 12.3.1 General ...... 196 12.3.2 Background...... object properties 197 12.3.3 Background...... object methods 197 12.4 BoundingBox ...... 197 12.5 Camera12.4.1 ...... General 197 12.4.2 BoundingBox...... properties 0- 197 W e8 12.5.2 Camera properties...... IE -2 198 V 07 12.5.112.5.3 GeneralCamera methods...... E a3 199 ) 4 12.6 CameraEvent...... R i 8 199 P a 56 1 . t/ 7- ...... D h is 5 199 R te /s 7 .i s 21 12.6.2 CameraEvent properties...... A s : d f- 199 d rd ar r 12.7 CameraEventHandler12.6.1 General ...... D r a d p 200 N a d n o- A d an ta is ...... t /s c/ 200 T n l s g 5 12.7.2 CameraEventHandler S methodsta .l...... lo 8 200 s u a cc eh ( F at 0 12.8 Canvas12.7.1 ...... General /c fa 201 iT ai c ...... b0 201 eh a it - 12.8.2 Canvas properties...... s. 43 201 rd a9 12.8.112.8.3 GeneralCanvas methods...... a 1- 201 nd f 12.9 ClippingPlane...... a 4b 202 st // ...... s: 202 tp 12.9.2 ClippingPlane Methodsht ...... 202 12.10 Color12.9.1...... General 202 ...... 202 12.10.2 Color properties...... 202 12.10.112.10.3 GeneralColor methods...... 202 12.11 HitInfo...... 203 ...... 203 12.11.2 HitInfo properties...... 204 12.12 Host12.11.1...... General 204 ...... 204 12.13 Image...... 204 12.12.1 General...... 204 12.13.2 Image properties...... 204 12.13.112.13.3 GeneralImage methods...... 204 ...... 205 ...... 205 12.14 KeyEvent ...... 205 12.14.1 General ...... 207 12.14.2 KeyEvent...... properties 207 12.15 KeyEventHandler ...... 208 12.16 Light12.15.1...... General 208 12.15.2 KeyEventHandler...... methods 208 12.16.2 Light properties...... 208 12.16.1 General vi PROOF/ÉPREUVE © ISO 2020 – All rights reserved ISO 21757-1:2020(E) 

12.17 Material...... 209 ...... 209 12.17.2 Material properties...... 209 12.17.1 General...... 210 ...... 210 12.18 Matrix4x4 ...... 210 12.18.1 General ...... 211 12.19 Mesh12.18.2...... Matrix4x4 Properties 219 12.18.3 Matrix4x4...... Methods 219 12.19.2 Mesh properties...... 219 12.19.112.19.3 GeneralMesh methods...... 219 12.20 MouseEvent...... 220 ...... 220 12.20.2 MouseEvent properties...... 220 12.21 MouseEventHandler12.20.1 General ...... 221 ...... 221 12.21.2 MouseEventHandler properties...... 221 12.21.112.21.3 GeneralMouseEventHandler methods...... 222 12.22 Node...... 222 ...... 222 12.22.2 Node properties...... 223 0- 12.22.112.22.3 GeneralNode methods...... W e8 223 IE -2 12.23 Quaternion...... V 07 224 E a3 ...... ) 4 224 R i 68 12.23.2 Quaternion methods...... P .a /5 -1 224 D h st 7 e si 75 12.24 RenderEvent12.23.1 General...... R it s/ 1 226 A s. : d -2 ...... rd r rf 226 D rd a da p N a ...... d n o- 12.24.2 RenderEvent propertiesA d an ta is 226 t /s c/ 12.25 RenderEventHandler12.24.1 General ...... T n l s g 5 226 S ta l lo 8 s u a cc ...... eh ( F at 0 226 /c fa 12.25.2 RenderEventHandleriT methodsai c ...... 226 . b0 eh a 12.26 Resource12.25.1 General...... it - 228 . 43 ...... ds 9 228 r -a da 1 12.26.2 Resource propertiesn bf ...... 228 ta 4 12.26.112.26.3 GeneralResource methods/s ...... 228 :/ 12.27 Runtime...... ps 228 tt ...... h 228 12.27.2 Runtime properties...... 228 12.27.112.27.3 GeneralRuntime methods...... 230 12.28 Scene...... 235 ...... 235 12.28.2 Scene methods...... 238 12.28.1 General...... 240 ...... 240 12.29 SceneObject ...... 240 12.29.1 General...... 240 12.30 SceneObjectList ...... 240 12.31 ScrollWheelEvent12.30.1 General ...... 241 12.30.2 SceneObjectList...... methods 241 12.31.2 ScrollWheelEvent...... 241 12.32 ScrollWheelEventHandler12.31.1 General ...... 242 ...... 242 12.32.2 ScrollWheelEventHandler methods...... 242 12.33 SelectionEvent12.32.1 General...... 242 ...... 242 12.33.2 SelectionEvent properties...... 242 12.34 SelectionEventHandler12.33.1 General ...... 243 ...... 243

12.34.1 General © ISO 2020 – All rights reserved PROOF/ÉPREUVE vii ISO 21757-1:2020(E) 

12.34.2 SelectionEventHandler methods...... 243 12.35 StateEvent...... 243 ...... 243 12.35.2 StateEvent properties...... 243 12.36 StateEventHandler12.35.1 General ...... 244 ...... 244 12.36.2 StateEventHandler methods...... 244 12.36.1 ...... General 244 ...... 244 12.37 Texture ...... 244 12.38 TimeEvent12.37.1 General...... 245 12.37.2 Texture ...... properties 245 12.38.2 TimeEvent properties...... 245 12.39 TimeEventHandler12.38.1 General ...... 245 ...... 245 12.39.2 TimeEventHandler methods...... 245 12.40 ToolEvent12.39.1 General...... 246 ...... 246 12.40.2 ToolEventHandler properties...... 246 12.41 ToolEventHandler12.40.1 General ...... 246 ...... 246 0- 12.41.2 ToolEventHandler methods...... W e8 246 IE -2 12.42 Vector312.41.1 ...... General V 07 247 E a3 ...... ) 4 247 R i 68 12.42.2 Vector3 methods...... P .a /5 -1 247 D h st 7 e si 75 12.43 View12.42.1...... General R it s/ 1 252 A s. : d -2 ...... rd r rf 252 D rd a da p ...... N a d n o- 12.43.2 View properties A d an ta is 252 t /s c/ 12.43.1 General T n l s g 5 ...... S ta l lo 8 Bibliography s u a cc 253 eh ( F at 0 /c fa iT ai c . b0 eh a it - s. 43 rd a9 a 1- nd f a 4b st // s: tp ht

viii PROOF/ÉPREUVE © ISO 2020 – All rights reserved ISO 21757-1:2020(E) 

Foreword

ISO (the International Organization for Standardization) is a worldwide federation of national standards

bodiescommittee (ISO hasmember been bodies).established The haswork the of rightpreparing to be International represented Standardson that committee. is normally International carried out through ISO technical committees. Each member body interested in a subject for which a technical

organizations,electrotechnical governmental standardization. and non-governmental, in liaison with ISO, also take part in the work. ISO collaborates closely with the International Electrotechnical Commission (IEC) on all matters of The procedures used to develop this document and those intended for its further maintenance are

described in the ISO/IEC Directives, Part 1. In particularwww ​.isothe ​different​directives approval). criteria needed for the different types of ISO documents should be noted. This document was drafted in accordance with the editorial rules of the ISO/IEC Directives, Part 2 (see .org/ Attention is drawn to the possibility that some of the elements of this document may be the subject of patenton the ISOrights. list ISOof patent shall declarationsnot be held responsible received (see for www identifying​.iso​ any​patents or all). such patent rights. Details of any patent rights identified during the development of the document will be in the Introduction and/or .org/ 0- constitute an endorsement. W e8 IE -2 Any trade name used in this document is informationV given for the07 convenience of users and does not E a3 ) 4 R i 68 P .a /5 -1 D h st 7 ForWorld an Trade explanation Organization on the (WTO) voluntary principles nature in the ofe standards, Technicalsi Barriers7 the5 meaning to Trade of ISO(TBT) specific see the terms following and R it s/ 1 A s. : d -2 expressionsURL: www​.iso related​ ​ to ​foreword conformity​. assessment,. as r welld r asrf information about ISO's adherence to the D rd a da p N a d n o- A d an ta is t /s c/ Document management applications .org/iso/ T n l s g 5 S ta l lo 8 Document file formats,s EDMSu a systemscc and authenticity of information. eh ( F at 0 This document was prepared by Technical Committee/c fa ISO/TC 171, , iT ai c . b0 Subcommittee SC 2, eh a it - complete listing of these bodies can be founds. 4 3at www​.iso​ ​members​.html. Any feedback or questions on this documentrd a9 should be directed to the user’s national standards body. A a 1- nd f a 4b .org/ st // s: tp ht

© ISO 2020 – All rights reserved PROOF/ÉPREUVE

ix ISO 21757-1:2020(E) 

Introduction

that can be used in ECMAScript scripts embedded in PDF documents to automate and interact with the This document specifies a set of ECMAScript object types which define the properties and methods

containingThe goal is PDF to documentenable the and implementation the PDF objects of withinECMAScript such files. processors within a broad range of PDF

Processors to provide interoperable scripting and automation of PDF documents. This functionality includes— processing the following forms withinfeatures, the among document; others: — batch processing collections of PDF documents; — developing and maintaining online collaboration schemes; — communicating with local databases.

are not documented here. Undocumented properties and methods should not be used. Certain properties and methods that may be discoverable through ECMAScript's introspection facilities 0- W e8 IE -2 V 07 E a3 ) 4 R i 68 P .a /5 -1 D h st 7 e si 75 R it s/ 1 A s. : d -2 rd r rf D rd a da p N a d n o- A d an ta is t /s c/ T n l s g 5 S ta l lo 8 s u a cc eh ( F at 0 /c fa iT ai c . b0 eh a it - s. 43 rd a9 a 1- nd f a 4b st // s: tp ht

PROOF/ÉPREUVE © ISO 2020 – All rights reserved

x INTERNATIONAL STANDARD ISO 21757-1:2020(E)

Document management — ECMAScript for PDF — Part 1: Use of ISO 32000-2 (PDF 2.0)

1 Scope documents and the contents of such documents. This document defines a set of ECMAScript objectives for automating and interacting with PDF 2 Normative references

The following documents are referred to in the text in such a way that some or all of their content 0- constitutes requirements of this document. For datedW references, onlye8 the edition cited applies. For IE -2 undated references,Document the managementlatest edition — of Portable the referenced DocumentV document Format0 (including7 — Part 2: PDFany amendments)2.0 applies. E a3 R ) 4 Information technology — Programmingi 6languages,8 their environments, and system ISO 32000-2, P .a /5 -1 D h st 7 software interfaces — ECMAScript® Specification eSuite si 75 R it s/ 1 ISO/IEC 22275:2018, A s. : d -2 rd r rf Information technologyD r—d ECMAScripta da p for XML (E4X) specification N a d n o- A d an ta is t /s c/ T n l s g 5 ISO/IEC 22537:2006, S ta l lo 8 s u a cc 3 Terms and definitions eh ( F at 0 /c fa iT ai c . b0 eh a it - s. 43 rd a9 ISO and IEC maintain terminological databasesa 1- for use in standardization at the following addresses: For the purposes of this document, thend termsf and definitions in ISO 32000-2 and the following . a 4b st // — ISO Online browsing platform:s: available at ​www​.iso​ ​obp tp ht — IEC Electropedia: available at ​www​.electropediaht t ps:// ​. .org/​ 3.1 ht t p:// org/ ECMAscript means of reference to ISO 22275 and ISO 22537

3.2 SHA

Secure Hash Algorithms, means of reference to FIPS 180-4 4 Notation

ECMAScript objects and properties and other predefined names are written in bold font; values, as well as key terms of interest are written in italic font. Some names can also be used as values, depending on the context, and so the styling of the content will be context specific. Methods, functions, and variables areEXAMPLE written 1 in Thefixed-width allowed values font. for the projectionType perspective and orthographic. property are

© ISO 2020 – All rights reserved PROOF/ÉPREUVE 1 ISO 21757-1:2020(E) 

Token characters used to delimit objects and describe the structure of PDF files, as defined in ISO 32000-2:—, 7.2.1, may be identified by their ISO/IEC 646 character name written in upper case in boldEXAMPLE font followed2 CARRIAGE by a parenthetic RETURN (0Dh). two digit hexadecimal character value with the suffix “h”.

Text string characters, as defined by ISO 32000-2:—, 7.9.2, may be identified by their ISO/IEC 10646-1 character name written in uppercase in bold font followed by a parenthetic four digit hexadecimal characterEXAMPLE 3code EN value SPACE with (U+2002). the prefix “U+”. R R

A property labeled as (read-only) is one whose value cannot be set. An objectR/W labeled as (read-only) is one whose reference cannot be modified, though the object itself can be set and its properties may be modified. Unless otherwise indicated, all properties and objects labeled with have read/write access. 5 Syntax

5.1 General

0- W e8 IE -2 Somemust beECMAScript spelled app objects (case-sensitive). are static objects that can be usedV as is and must07 be spelled as indicated. For E a3 example, the app object represents the ECMAScript application.) There4 is only one such object and it R i 68 P .a /5 -1 D h st 7 obtained and assigned to a variable: e si 75 R it s/ 1 Other objects are dynamic objects that can be assignedA s. to a :variable.d -2 For example, a Doc object may be rd r rf var myDoc = app.newDoc(); D rd a da p N a d n o- A d an ta is t /s c/ T n l s g 5 S ta l lo 8 s u a cc eh ( F at 0 /c fa In thismyDoc.closeDoc(); example, myDoc can access all imethodsT and propertiesai c of the Doc object. For example: . b0 eh a 5.2 Method arguments it - . 43 ds 9 r -a da 1 n bf ta 4 /s :/ Many of the ECMAScript methods acceptps either a list of arguments, as is customary in ECMAScript, or tt a single object argument with propertiesh that contain the arguments. For example, these two calls are equivalent: app.alert( "Multimedia", 3);

and

app.alert({ cMsg: "Multimedia", nIcon: 3});

NOTE The ECMAScript methods defined in support of multimedia do not accept these two argument formats interchangeably. Use the exact argument format described for each method. 6 Paths Several methods take device-independent paths as arguments. See ISO 32000-2 for details about the device-independent path format.

7 Safe path Developers of PDF Processor software implementing ECMAScript support are encouraged to support the concept of a safe path for ECMAScript methods that write data to the local hard drive based on a

path passed to it by one of its parameters.

2 PROOF/ÉPREUVE © ISO 2020 – All rights reserved ISO 21757-1:2020(E) 

A path cannot point to a system critical folder, for example a root, windows or system directory. A path is also subject to other unspecified tests. Forthe documentation.many methods, the file name must have an extension appropriate to the type of data that is to be saved. Some methods may have a no-overwrite restriction. These additional restrictions are noted in NotAllowedError 10.15 Error) and the method fails. Generally, when a path is judged to not be safe, a exception is thrown (see 8 Privileged context

An application context in which the application has the permissions necessary to do something on behalf of the current user that is normally restricted. Such permission (or privilege) could be granted by executing a method in a specific way (through the console or batch process), by some PDF property, orthe because ECMAScript the document to run where was itsigned otherwise with awould digital not. signature trusted by the user. For example, trusting a document certifier’s certificate for executing ECMAScript creates a privileged context which enables 9 Privileged versus non-privileged context 0- W e8 IE -2 [Security]V 07 E a3 ) 4 R i 68 Some ECMAScript methods, identified with P a .a /5 note,-1 have security restrictions. These D h st 7 methodsnon-privileged. can be executed only in a privileged context,e whichsi 7 5includes console, batch and application R it s/ 1 initialization events. All other events (forA example,s. :paged open-2 and mouse-up events) are considered rd r rf D rd a da p N a d n o- A d an ta is t /s c/ T n l s g 5 The description of each security-restricted S ta methodl lo indicates8 the events during which the method can s u a cc eh ( F at 0 be executed. /c fa iT ai c 10 ECMAScript API . b0 eh a it - s. 43 rd a9 10.1 General a 1- nd f a 4b st // s: tp ht This section is a complete reference to the PDF extensions to ECMAScript, its objects, methods, and properties. The section is organized alphabetically by object name.

10.2More informationAnnotation regarding the ECMAScript core can be found in ISO/IEC 22537.

10.2.1 General markup annotation Doc addAnnotThis object. represents a PDF (See ISO 32000-2:—, “12.5.6.2 Markup annotations” for more details). Annotations can be created through ECMAScript by using the object method Doc method such as getAnnot: Before an annotation can be accessed, it must be bound to an ECMAScript variable through a object var a = this.getAnnot(0, "Important");

a The script can then manipulatea in thethe variableannotation thetype named “Important” on page 1 (0-based page numbering system) by means of the variable . For example, the following code first stores the type of the annotationvar thetype represented = a.type; by // read property, then changes the author to “John Q. Public”. a.author = "John Q. Public"; // write property

© ISO 2020 – All rights reserved PROOF/ÉPREUVE 3