DropdownFieldSettings

6 Jul 20263 minutes to read

The DropdownFieldSettings is used to to show and customize the appearance of drop down element.

<div id="pdfViewer" style="height: 100%;width: 100%;"></div>
 let viewer: PdfViewer = new PdfViewer();
 // Change the drop down field settings.
 viewer.DropdownFieldSettings = {
     bounds: { x:0,y:0, width: 0, height: 0 },
     name: '',
     value: '',
     fontFamily: 'Helvetica',
     fontSize: 10,
     pageNumber: 0,
     fontStyle: 'None',
     color: 'black',
     backgroundColor: 'white',
     alignment: 'Left',
     isReadOnly: true,
     visibility: 'visible',
     isPrint: true,
     tooltip: '',
     isRequired: false,
     options: '',
     thickness: 5,
     borderColor: '303030',
     customData: null
 };
 viewer.appendTo("#pdfViewer");

Properties

alignment TextAlignment

Get or set the alignment of the text.

Defaults to ‘Left’

backgroundColor string

Get or set the background color of the dropdown in hexadecimal string format.

Defaults to ‘white’

borderColor string

Get or set the border color of the drop down field.

Defaults to ‘#303030’

bounds IFormFieldBound

Get or set the form field bounds.

Defaults to { x: 0, y: 0, width: 0, height: 0 }

color string

Get or set the font color of the dropdown in hexadecimal string format..

Defaults to ‘black’

customData object

specifies the custom data of the form fields.

Defaults to null

fontFamily string

Get or set the font family of the dropdown field.

Defaults to ‘Helvetica’

fontSize number

Get or set the font size of the dropdown field.

Defaults to 10

fontStyle FontStyle

Get or set the font style of dropdown field.

Defaults to ‘None’

isPrint boolean

Get or set the boolean value to print the dropdown field. TRUE by default.

Defaults to false

isReadOnly boolean

Specifies whether the dropdown field is in read-only or read-write mode. FALSE by default.

Defaults to false

isRequired boolean

If it is set as true, consider as mandatory field in the PDF document. By default it is false.

Defaults to false

name string

Get or set the name of the dropdown.

Defaults to ’’

options ItemModel[]

Get or set the dropdown items.

Defaults to []

pageNumber number

specifies the page number of the form field.

Defaults to 0

thickness number

Get or set the thickness of the drop down field.

Defaults to 1

tooltip string

Get or set the text to be displayed as tooltip. By default it is empty.

Defaults to ’’

value string

Get or set the value of the form field.

Defaults to ’’

visibility Visibility

Gets or set the visibility of the form field.

Defaults to ‘visible’