Class: Annotation

Annotation

Creates a new instance of Annotation.


new Annotation(initOptions)

Parameters:
Name Type Description
initOptions object

The initialization options for the annotation.

Properties
Name Type Description
annotation object

The annotation data.

documentViewer core.DocumentViewer

The DocumentViewer instance.

Members


PageNumber

The page number the annotation is on.


X

The X coordinate of the annotation.


Y

The Y coordinate of the annotation.


author

The author of the annotation.


contents

The contents of the annotation.


dateCreated

The date the annotation was created.


inReplyTo

The annotation this annotation is replying to.


measure

Whether the annotation is a measurement.


name

The unique name of the annotation.


pageIndex

The page index the annotation is on.


type

The type of the annotation.

Methods


deleteCustomData(key)

Deletes custom data associated with this annotation.

Parameters:
Name Type Description
key string

The key of the custom data to delete.


draw()

Draws the annotation on the document.


getContents()

Gets the contents of the annotation.

Returns:

The contents of the annotation.

Type
string

getCustomData()

Gets custom data associated with this annotation.

Returns:

The custom data.

Type
object

getHeight()

Get the height of the annotation.

Returns:

The height of the annotation.

Type
number

getMarked()

Returns whether the annotation is marked.

Returns:

True if the annotation is marked, false otherwise.

Type
boolean

getPageNumber()

Get the page number of the annotation.

Returns:

The page number of the annotation.

Type
number

getRect()

Get the rectangle of the annotation.

Returns:

The rectangle of the annotation in the format {x1, y1, x2, y2}.

Type
object

getReplies()

Returns all replies to this annotation.

Returns:

An array of reply annotations.

Type
Array.<Annotation>

getStatus()

Gets the status of the annotation.

Returns:

The status of the annotation.

Type
string

getWidth()

Get the width of the annotation.

Returns:

The width of the annotation.

Type
number

getX()

get the x coordinate of the annotation.

Returns:

The x coordinate of the annotation.

Type
number

getY()

get the y coordinate of the annotation.

Returns:

The y coordinate of the annotation.

Type
number

isReply()

Returns whether this annotation is a reply.

Returns:

True if this annotation is a reply, false otherwise.

Type
boolean

serialize()

exports the annotation to a serializable object.

Returns:

The serialized annotation object.

Type
object

setContents(contents)

Sets the contents of the annotation.

Parameters:
Name Type Description
contents string

The new contents of the annotation.


setCustomData(key, value)

Sets custom data associated with this annotation.

Parameters:
Name Type Description
key string

The key of the custom data.

value string

The value of the custom data.


setStatus(status)

Sets the status of the annotation.

Parameters:
Name Type Description
status string

The new status of the annotation.