InitialFieldSettings

6 Jul 20263 minutes to read

The InitialFieldSettings module is used to set the properties of initial field in PDF Viewer

<div id="pdfViewer" style="height: 100%;width: 100%;"></div>
 let viewer: PdfViewer = new PdfViewer();
 // Changes the initial field settings.
 viewer.initialFieldSettings = {
     bounds: {x:0, y:0, width:0, height:0},
     name: "",
     isReadOnly: true,
     visibility: "visible",
     isRequired: true,
     isPrint: true,
     tooltip: "",
     thickness: 1,
     pageNumber: 0,
     isInitialField: false,
     initialIndicatorSettings: {
         opacity: 1,
         backgroundColor: "orange",
         width: 19,
         height: 10,
         fontSize: 10,
         text: null,
         color: "black"
     },
     initialDialogSettings: {
        displayMode: DisplayMode.Draw | DisplayMode.Text | DisplayMode.Upload,
         hideSaveSignature: false
     },
     customData: null,
     typeInitialFonts: ['arial']
 };
 viewer.appendTo("#pdfViewer");

Properties

bounds IFormFieldBound

Get or set the form field bounds.

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

customData object

specifies the custom data of the form fields.

Defaults to null

initialDialogSettings SignatureDialogSettingsModel

Get or set the signature dialog settings for initial field.

initialIndicatorSettings SignatureIndicatorSettingsModel

Specifies the properties of the signature indicator in the initial field.

isInitialField boolean

Gets or sets the initial field type of the signature field.

Defaults to false

isPrint boolean

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

Defaults to false

isReadOnly boolean

Specifies whether the initial 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 form field element.

Defaults to ’’

pageNumber number

specifies the page number of the form field.

Defaults to 0

thickness number

Get or set the thickness of the Initial field. Default value is 1. To hide the borders, set the value to 0 (zero).

Defaults to 1

tooltip string

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

Defaults to ’’

typeInitialFonts { [key: number]: string }

Allows setting the font name for typed initials at specific indices. The maximum number of font names is limited to 4, so the key values should range from 0 to 3.

visibility Visibility

Gets or set the visibility of the form field.

Defaults to ‘visible’