FreeTextSettings

9 Jul 20264 minutes to read

The FreeTextSettings module is used to provide the properties to free text annotation.

<div id="pdfViewer" style="height: 100%;width: 100%;"></div>
 let viewer: PdfViewer = new PdfViewer();
 // Change the free text annotation settings.
 viewer.freeTextSettings = {
     offset: { x:0, y:0 },
     pageNumber: 1,
     opacity: 1,
     fillColor: '#4070FF',
     borderColor: '#4070FF',
     author: 'Guest',
     borderWidth: 1,
     borderStyle: 'solid',
     width: 151,
     fontSize: 16,
     height: 24.6,
     fontColor: '#000',
     fontFamily: 'Courier',
     defaultText: 'Type Here',
     fontStyle: 'None',
     textAlignment: 'Right',
     fontStyle: FontStyle.Italic,
     allowTextOnly: false,
     annotationSelectorSettings: {
         selectionBorderColor: '',
         resizerBorderColor: 'black',
         resizerFillColor: '#FF4081',
         resizerSize: 8,
         selectionBorderThickness: 1,
         resizerShape: 'Circle',
         selectorLineDashArray: [],
         resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges,
         resizerCursorType: null
     },
     minHeight: 0,
     minWidth: 0,
     maxWidth: 0,
     maxHeight: 0,
     isLock: false,
     customData: null,
     allowedInteractions: ['None'],
     isPrint: true,
     isReadonly: false,
     enableAutoFit: false,
     subject: ''
 };
 viewer.appendTo("#pdfViewer");

Properties

allowEditTextOnly boolean

specifies the allow text only action of the free text annotation.

Defaults to false

allowedInteractions AllowedInteraction[]

Gets or sets the allowed interactions for the locked free text annotations.
IsLock can be configured using free text settings.

Defaults to [‘None’]

annotationSelectorSettings AnnotationSelectorSettingsModel

specifies the annotation selector settings of the annotation.

Defaults to ’’

author string

specifies the author of the annotation.

Defaults to ‘Guest’

borderColor string

specifies the border color of the annotation.

Defaults to ‘#000000’

borderStyle string

specifies the border style of the annotation.

Defaults to ‘solid’

borderWidth number

specifies the border with of the annotation.

Defaults to 0

customData object

specifies the custom data of the annotation.

Defaults to null

defaultText string

setting the default text for annotation.

Defaults to ‘TypeHere’

enableAutoFit boolean

Enable or disable auto fit mode for FreeText annotation in the Pdfviewer. FALSE by default.

Defaults to false

fillColor string

specifies the background fill color of the annotation.

Defaults to ‘#ffffff00’

fontColor string

specifies the text box font color of the annotation.

Defaults to ‘#000’

fontFamily string

specifies the text box font family of the annotation.

Defaults to ‘Helvetica’

fontSize number

specifies the text box font size of the annotation.

Defaults to 16

fontStyle FontStyle

applying the font styles for the text.

Defaults to ‘None’

height number

specifies the height of the annotation.

Defaults to 24.6

isLock boolean

specifies the locked action of the annotation.

Defaults to false

isPrint boolean

specifies whether the individual annotations are included or not in print actions.

Defaults to true

isReadonly boolean

Enables or disables text editing for the annotation. FALSE, by default.

Defaults to false

maxHeight number

specifies the maxHeight of the annotation.

Defaults to 0

maxWidth number

specifies the maxWidth of the annotation.

Defaults to 0

minHeight number

specifies the minHeight of the annotation.

Defaults to 0

minWidth number

specifies the minWidth of the annotation.

Defaults to 0

offset IPoint

Get or set offset of the annotation.

Defaults to { x: 0, y: 0}

opacity number

specifies the opacity of the annotation.

Defaults to 1

pageNumber number

Get or set page number of the annotation.

Defaults to 1

subject string

specifies the subject of the annotation.

Defaults to ’’

textAlignment TextAlignment

Aligning the text in the annotation.

Defaults to ‘Left’

width number

specifies the width of the annotation.

Defaults to 151