|
| 1 | +--- |
| 2 | +layout: default-layout |
| 3 | +needAutoGenerateSidebar: true |
| 4 | +needGenerateH3Content: true |
| 5 | +noTitleIndex: true |
| 6 | +title: Dynamsoft Document Viewer API Reference - Ellipse Class |
| 7 | +keywords: Documentation, Dynamsoft Document Viewer, API Reference, Ellipse Class |
| 8 | +breadcrumbText: Ellipse Class |
| 9 | +description: Dynamsoft Document Viewer Documentation API Reference Ellipse Class Page |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +# Ellipse Class |
| 14 | + |
| 15 | + |
| 16 | +## API Index |
| 17 | + |
| 18 | +| API Name | Description | |
| 19 | +| --------------------------------------- | ------------------------------------------------------------------------------------------- | |
| 20 | +| [`uid`](#uid) | Return the uid of the annotation. | |
| 21 | +| [`pageUid`](#pageuid) | Return the uid of the page where the annotation is located. | |
| 22 | +| [`source`](#source) | Return the source of the annotation. | |
| 23 | +| [`type`](#type) | Return the type of the annotation | |
| 24 | +| [`creationDate`](#creationdate) | Return the creation date of the annotation. | |
| 25 | +| [`flattened`](#flattened) | Flattens the annotation onto the image layer, or inspect if the annotation is flattened. | |
| 26 | +| [`modificationDate`](#modificationdate) | Return the modification date of the annotation. | |
| 27 | +| [`getOptions()`](#getoptions) | Get the annotation options. | |
| 28 | +| [`updateOptions()`](#updateoptions) | Update the annotation options. | |
| 29 | + |
| 30 | +## uid |
| 31 | + |
| 32 | +Return the uid of the annotation. |
| 33 | + |
| 34 | +**Syntax** |
| 35 | + |
| 36 | +```typescript |
| 37 | +readonly uid: string; |
| 38 | +``` |
| 39 | + |
| 40 | +{% comment %} |
| 41 | +**Remark** |
| 42 | + |
| 43 | +- It will return `''`, if the annotation is deleted. |
| 44 | +{% endcomment %} |
| 45 | + |
| 46 | +## pageUid |
| 47 | + |
| 48 | +Return the uid of the page where the annotation is located. |
| 49 | + |
| 50 | +**Syntax** |
| 51 | + |
| 52 | +```typescript |
| 53 | +readonly pageUid: string; |
| 54 | +``` |
| 55 | + |
| 56 | +**Remark** |
| 57 | + |
| 58 | +- It will return `''`, if the annotation is deleted. |
| 59 | + |
| 60 | +{% comment %} |
| 61 | +## aabb |
| 62 | + |
| 63 | +Return Axis-aligned bounding box of the annotation. |
| 64 | + |
| 65 | +**Syntax** |
| 66 | + |
| 67 | +```typescript |
| 68 | +readonly aabb: Rect; |
| 69 | +``` |
| 70 | + |
| 71 | +**Remark** |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | +{% endcomment %} |
| 76 | + |
| 77 | +## source |
| 78 | + |
| 79 | +Return the source of the annotation. Possible values: |
| 80 | + |
| 81 | +* user: the annotation is created by the user's action |
| 82 | +* file: the annotation is created from a PDF file |
| 83 | +* api: the annotation is created with code |
| 84 | + |
| 85 | +**Remark** |
| 86 | + |
| 87 | +It will return `''`, if the annotation is deleted. |
| 88 | + |
| 89 | +## type |
| 90 | + |
| 91 | +Return the type of the annotation: `ellipse`. |
| 92 | + |
| 93 | +All annotation types: |
| 94 | + |
| 95 | +```ts |
| 96 | +"rectangle" | "ellipse" | "line" | "polygon" | "polyline" | "ink" | "textBox" | "textTypewriter" | "stamp" | "highlight" | "underline" | "strikeout" | "incomplete" | "unknown" |
| 97 | +``` |
| 98 | + |
| 99 | +## creationDate |
| 100 | + |
| 101 | +Return the creation date of the annotation. |
| 102 | + |
| 103 | +**Syntax** |
| 104 | + |
| 105 | +```typescript |
| 106 | +readonly creationDate: string; |
| 107 | +``` |
| 108 | + |
| 109 | +**Remark** |
| 110 | + |
| 111 | +- The string would be `D:YYYYMMDDHHmmSSOHH'mm'`, like `D:20230101085959-08'00'`. |
| 112 | + |
| 113 | +{% comment %} |
| 114 | +- It will return `''`, if the annotation is deleted. |
| 115 | +{% endcomment %} |
| 116 | + |
| 117 | +## flattened |
| 118 | + |
| 119 | +Flattens the annotation onto the image layer, or inspect if the annotation is flattened. |
| 120 | + |
| 121 | +**Syntax** |
| 122 | + |
| 123 | +```typescript |
| 124 | +flattened: boolean; //Default value is `false`. |
| 125 | +``` |
| 126 | + |
| 127 | +**Remark** |
| 128 | + |
| 129 | +Flattened annotations move below all unflattened annotations on the page, and are stacked amongst themselves accordingly. |
| 130 | + |
| 131 | +Flattened annotations become part of the page layer upon file export and cease to be annotations. |
| 132 | + |
| 133 | +## modificationDate |
| 134 | + |
| 135 | +Return the modification date of the annotation. |
| 136 | + |
| 137 | +**Syntax** |
| 138 | + |
| 139 | +```typescript |
| 140 | +readonly modificationDate: string; |
| 141 | +``` |
| 142 | + |
| 143 | +**Remark** |
| 144 | + |
| 145 | +- The string would be `D:YYYYMMDDHHmmSSOHH'mm'`, like `D:20230101085959-08'00'`. |
| 146 | +- It will return `''`, if the annotation is deleted. |
| 147 | +- If the annotation is created but not be modified after adding, it equals to [`creationDate`](#creationdate). |
| 148 | + |
| 149 | +## getOptions() |
| 150 | + |
| 151 | +Get the annotation options. |
| 152 | + |
| 153 | +**Syntax** |
| 154 | + |
| 155 | +```typescript |
| 156 | +getOptions(): EllipseAnnotationOptions; |
| 157 | +``` |
| 158 | + |
| 159 | +**Return value** |
| 160 | + |
| 161 | +The object of ellipse annotation options. Please refer to [`EllipseAnnotationOptions`]({{ site.api }}interface/annotationinterface/ellipseannotationoptions.html). |
| 162 | + |
| 163 | +**Code Snippet** |
| 164 | + |
| 165 | +```typescript |
| 166 | +// Given that editViewer is an existing instance of EditViewer and a document is currently open. |
| 167 | +const pageUid = editViewer.indexToUid(0); |
| 168 | +const ellipse = Dynamsoft.DDV.annotationManager.createAnnotation(pageUid, "ellipse"); // Create a default Ellipse annotation instance. |
| 169 | +const ellipseOptions = ellipse.getOptions(); |
| 170 | +``` |
| 171 | + |
| 172 | +## updateOptions() |
| 173 | + |
| 174 | +Update the annotation options. |
| 175 | + |
| 176 | +**Syntax** |
| 177 | + |
| 178 | +```typescript |
| 179 | +updateOptions(ellipseAnnotationOptions: EllipseAnnotationOptions): boolean; |
| 180 | +``` |
| 181 | + |
| 182 | +**Parameters** |
| 183 | + |
| 184 | +`ellipseAnnotationOptions`: The new ellipse annotation options. Please refer to [`EllipseAnnotationOptions`]({{ site.api }}interface/annotationinterface/ellipseannotationoptions.html). |
| 185 | + |
| 186 | +**Return value** |
| 187 | + |
| 188 | +`true`: Successfully. |
| 189 | + |
| 190 | +`false`: Failed. |
| 191 | + |
| 192 | +**Code Snippet** |
| 193 | + |
| 194 | +```typescript |
| 195 | +// Given that editViewer is an existing instance of EditViewer and a document is currently open. |
| 196 | +const pageUid = editViewer.indexToUid(0); |
| 197 | +const ellipse = Dynamsoft.DDV.annotationManager.createAnnotation(pageUid, "ellipse"); // Create a default Ellipse annotation instance. |
| 198 | +const ellipseOptions = { |
| 199 | + background: "red", |
| 200 | +}; |
| 201 | +ellipse.updateOptions(ellipseOptions); // Update the background of the ellipse to red. |
| 202 | +``` |
| 203 | + |
| 204 | +**Warning** |
| 205 | + |
| 206 | + Error Code | Error Message | API Return Value |
| 207 | +--------|-----------------------------------------------------|---------------------- |
| 208 | + -80100 | *XXX(API)*: *XXX(ParameterName)* is invalid. | `false` |
| 209 | + -80102 | *XXX(API)*: *XXX(ParameterName)* is missing. | `false` |
0 commit comments