Text annotation.

Hierarchy

Properties

annotationName: string

Annotation name (NM entry).

annotationType: AnnotationTypeCode

Annotation type.

appearanceColor?: string

Appearance color.

borderStyle?: { dashArray?: number[]; horizontalCornerRadius: number; style: number; verticalCornerRadius: number; width: number }

Annotation's border style.

Type declaration

  • Optional dashArray?: number[]

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

  • horizontalCornerRadius: number
  • style: number

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

  • verticalCornerRadius: number
  • width: number

    Border width.

color?: string

Annotation color.

contents?: string

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

convertToContent?: boolean

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

creationDate: string

Creation date.

display?: "visible" | "hidden"

The field is used for compatibility with Adobe Acrobat Reader.

Internal helper property. The State to which original annotation is set by current user.

gcProps?: GcProps

Additional custom properties. Only available for use with DsPdf.

hasPopup: boolean

Indicates if annotation has associated popup annotation.

id: string

Annotation id.

invisibleFlag: boolean

true if the annotation is hidden.

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.

locked: boolean

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

Example

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');
modificationDate: string

Modification date.

name: "Comment" | "Key" | "Note" | "Help" | "NewParagraph" | "Paragraph" | "Insert"

Icon name.

Default

'Comment'

opacity?: number

Annotation opacity.

open: boolean

Initially opened state.

orderIndex: number

The field order index.

parentAnnotation?: AnnotationBase

Resolved reference to parent annotation.

parentId?: string

Parent annotation id for popup annotation.

popupId: string

Popup annotation identifier.

printableFlag: boolean

Specifies whether or not the annotation can be printed.

rect: number[]

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

redacted: boolean

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

redactedBy: string

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

referenceAnnotationId: string

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

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.

rotate?: number

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

sharedChanges?: { [userName: string]: number }

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

Type declaration

  • [userName: string]: number

The State to which original annotation should be set.

The sateModel corresponding to State.

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.

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'

textAlignment: TextAlignmentType

The alignment of the text.

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.