# ChoiceWidget

## Content

# Class: ChoiceWidget

Choice field widget.

## Extends

- [`WidgetAnnotation`](WidgetAnnotation)

## Properties

### alternativeText?

```ts
optional alternativeText: string;
```

An alternate field text to be used as tooltip.
This text is also useful when extracting the document’s contents in support of accessibility
to users with disabilities or for other purposes.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`alternativeText`](WidgetAnnotation#alternativetext)

***

### annotationName

```ts
annotationName: string;
```

Annotation name (NM entry).

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`annotationName`](WidgetAnnotation#annotationname)

***

### annotationType

```ts
annotationType: AnnotationTypeCode;
```

Annotation type.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`annotationType`](WidgetAnnotation#annotationtype)

***

### appearanceColor?

```ts
optional appearanceColor: string;
```

Appearance color.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`appearanceColor`](WidgetAnnotation#appearancecolor)

***

### borderStyle?

```ts
optional borderStyle: object;
```

Annotation's border style.

#### dashArray?

```ts
optional dashArray: number[];
```

Border dash pattern. Used when the border style is dashed.

#### horizontalCornerRadius

```ts
horizontalCornerRadius: number;
```

#### style

```ts
style: number;
```

Border style. Possible values: 1 - solid style (default), 2 - dashed style.

#### verticalCornerRadius

```ts
verticalCornerRadius: number;
```

#### width

```ts
width: number;
```

Border width.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`borderStyle`](WidgetAnnotation#borderstyle)

***

### color?

```ts
optional color: string;
```

Annotation color.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`color`](WidgetAnnotation#color)

***

### combo

```ts
combo: boolean;
```

Combo box field flag.

***

### contents?

```ts
optional contents: string;
```

The text (or rich text) string that shall be displayed in the pop-up when the annotation is opened.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`contents`](WidgetAnnotation#contents)

***

### convertToContent?

```ts
optional convertToContent: boolean;
```

Indicates whether the annotation will be converted to content when the document is saved.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`convertToContent`](WidgetAnnotation#converttocontent)

***

### creationDate

```ts
creationDate: string;
```

Creation date.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`creationDate`](WidgetAnnotation#creationdate)

***

### display?

```ts
optional display: "hidden" | "visible";
```

The field is used for compatibility with Adobe Acrobat Reader.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`display`](WidgetAnnotation#display)

***

### fieldName

```ts
fieldName: string;
```

Field name.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`fieldName`](WidgetAnnotation#fieldname)

***

### fieldType

```ts
fieldType: WidgetFieldTypeName;
```

Field type.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`fieldType`](WidgetAnnotation#fieldtype)

***

### fieldValue

```ts
fieldValue: string | string[];
```

Field widget value.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`fieldValue`](WidgetAnnotation#fieldvalue)

***

### fontName

```ts
fontName: string;
```

Font name.
Available standard font names:
'Helv' (Helvetica), 'HelveticaItalic' (Helvetica Italic), 'HelveticaBold' (Helvetica Bold),
'HelveticaBoldItalic' (Helvetica Bold Italic),
'TimesRegular' (Times Roman), 'TimesItalic' (Times Roman Italic),
'TimesBold' (Times Roman Bold), 'TimesBoldItalic' (Times Roman Bold Italic),
'CourierRegular' (Courier), 'CourierItalic' (Courier Italic), 'CourierBold' (Courier Bold),
'CourierBoldItalic' (Courier Bold Italic), 'Symbol' (Text symbol letters)

#### Default

```ts
"Helv"
```

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`fontName`](WidgetAnnotation#fontname)

***

### fontSize

```ts
fontSize: number;
```

Font size.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`fontSize`](WidgetAnnotation#fontsize)

***

### gcProps?

```ts
optional gcProps: GcProps;
```

Additional custom properties.
Only available for use with DsPdf.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`gcProps`](WidgetAnnotation#gcprops)

***

### hasEditFlag

```ts
hasEditFlag: boolean;
```

Gets or sets a value indicating whether the combo box includes an editable text
box as well as a drop-down list.

***

### id

```ts
id: string;
```

Annotation id.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`id`](WidgetAnnotation#id)

***

### invisibleFlag

```ts
invisibleFlag: boolean;
```

true if the annotation is hidden.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`invisibleFlag`](WidgetAnnotation#invisibleflag)

***

### irtAnnotations?

```ts
optional irtAnnotations: AnnotationBase[];
```

Internal helper property.
Primary annotation's children annotations.
Note, the array contains all children annotations, including annotations what is not direct descendant of the primary annotation.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`irtAnnotations`](WidgetAnnotation#irtannotations)

***

### isRichContents

```ts
isRichContents: boolean;
```

Specifies whether or not the RichContent mode is used for the contents property.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`isRichContents`](WidgetAnnotation#isrichcontents)

***

### locked

```ts
locked: boolean;
```

Specifies whether the annotation can be deleted or its properties (including position and size) can be modified by the user.

#### Example

```javascript
var viewer = new DsPdfViewer('#root', { renderInteractiveForms: true , supportApi: { apiUrl: 'api/pdf-viewer', webSocketUrl: false } });
viewer.addDefaultPanels();
viewer.addAnnotationEditorPanel();
viewer.addFormEditorPanel();
viewer.addReplyTool();
viewer.onAfterOpen.register(()=>{
	// Lock all text annotations after document open:
	const resultArr = await viewer.findAnnotation(1, // 1 - AnnotationTypeCode.TEXT
						  { findField: 'annotationType',
				  		    pageNumberConstraint: 1, findAll: true });
	viewer.updateAnnotations(0, resultArr.map((data)=> { data.annotation.locked = true; return data.annotation; }));
});
// Open Annotations.pdf
viewer.open('Annotations.pdf');
```

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`locked`](WidgetAnnotation#locked)

***

### modificationDate

```ts
modificationDate: string;
```

Modification date.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`modificationDate`](WidgetAnnotation#modificationdate)

***

### multiSelect

```ts
multiSelect: boolean;
```

List box flag.

***

### opacity?

```ts
optional opacity: number;
```

Annotation opacity.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`opacity`](WidgetAnnotation#opacity)

***

### options

```ts
options: object[];
```

Choice options.

#### displayValue

```ts
displayValue: string;
```

#### exportValue

```ts
exportValue: string;
```

***

### orderIndex

```ts
orderIndex: number;
```

The field order index.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`orderIndex`](WidgetAnnotation#orderindex)

***

### orientation?

```ts
optional orientation: number;
```

The number of degrees by which the widget annotation shall be rotated counterclockwise relative to the page.
The value shall be a multiple of 90. Default value: 0.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`orientation`](WidgetAnnotation#orientation)

***

### parentAnnotation?

```ts
optional parentAnnotation: AnnotationBase;
```

Resolved reference to parent annotation.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`parentAnnotation`](WidgetAnnotation#parentannotation)

***

### parentId?

```ts
optional parentId: string;
```

Parent annotation id for popup annotation.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`parentId`](WidgetAnnotation#parentid)

***

### popupId?

```ts
optional popupId: string;
```

Popup id if any.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`popupId`](WidgetAnnotation#popupid)

***

### printableFlag

```ts
printableFlag: boolean;
```

Specifies whether or not the annotation can be printed.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`printableFlag`](WidgetAnnotation#printableflag)

***

### readOnly

```ts
readOnly: boolean;
```

Read-only flag.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`readOnly`](WidgetAnnotation#readonly)

***

### rect

```ts
rect: number[];
```

The annotation's bounds rectangle: [x1, y1, x2, y2].
(0, 0) is the bottom left corner of the page.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`rect`](WidgetAnnotation#rect)

***

### redacted

```ts
redacted: boolean;
```

Indicates whether the current annotation has been redacted.
Redacted annotations will be removed from the document after saving.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`redacted`](WidgetAnnotation#redacted)

***

### redactedBy

```ts
redactedBy: string;
```

ID of the Redact annotation that was used to redact the current annotation.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`redactedBy`](WidgetAnnotation#redactedby)

***

### referenceAnnotationId

```ts
referenceAnnotationId: string;
```

Id of the primary annotation to which this annotation belongs. ("in reply to" value).

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`referenceAnnotationId`](WidgetAnnotation#referenceannotationid)

***

### referenceType

```ts
referenceType: "R" | "Group";
```

R - this annotation is reply to the primary annotation specified by field referenceAnnotationId.
Group - annotation should be grouped with primary annotation specified by field referenceAnnotationId.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`referenceType`](WidgetAnnotation#referencetype)

***

### rotate?

```ts
optional rotate: number;
```

The number of degrees by which the annotation shall be rotated relative to the page.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`rotate`](WidgetAnnotation#rotate)

***

### sharedChanges?

```ts
optional sharedChanges: object;
```

Hash object with information about users who change this annotation.
key - user name
value - UNIX UTC timestamp when changes were added.

#### Index Signature

```ts
[userName: string]: number
```

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`sharedChanges`](WidgetAnnotation#sharedchanges)

***

### state?

```ts
optional state: 
  | AnnotationMarkedStateType
  | AnnotationReviewStateType;
```

Beginning with PDF 1.5, Annotations may have author-specific state associated with them.
The state is not specified in the annotation itself but in separate text annotation that
refers to the original annotation by means of its 'IRT' ("in reply to") entry.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`state`](WidgetAnnotation#state)

***

### stateModel?

```ts
optional stateModel: AnnotationStateModel;
```

The state model corresponding to state.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`stateModel`](WidgetAnnotation#statemodel)

***

### subject

```ts
subject: string;
```

Text representing a short description of the subject being addressed by the annotation.
The 'subject' is the meta information property and it can be used to group,
sort or filter annotations.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`subject`](WidgetAnnotation#subject)

***

### subtype

```ts
subtype: AnnotationTypeName;
```

Annotation sub-type. Possible values are: 'Text', 'Link', 'FreeText', 'Line', 'Square', 'Circle', 'Polygon', 'PolyLine',
'Highlight', 'Underline', 'Squiggly', 'Strikeout', 'Stamp', 'Caret', 'Ink', 'Popup', 'FileAttachment',
'Sound', 'Movie', 'Widget', 'Screen', 'PrinterMark', 'TrapNet', 'WaterMark',
'Redact', 'Signature', 'ThreadBead', 'RadioButton', 'Checkbox', 'PushButton', 'Choice', 'TextWidget',
'RichMedia'

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`subtype`](WidgetAnnotation#subtype)

***

### textAlignment

```ts
textAlignment: TextAlignmentType;
```

The alignment of the text.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`textAlignment`](WidgetAnnotation#textalignment)

***

### title

```ts
title: string;
```

The text label that shall be displayed in the title bar of
the annotation's popup when open and active. This entry shall identify
the user who added the annotation.

#### Inherited from

[`WidgetAnnotation`](WidgetAnnotation).[`title`](WidgetAnnotation#title)
