Skip to main content
Version: Version 5

Class: FreeTextAnnotation

An annotation that displays text

For a free-text annotation, the annotation’s content is used as text to be displayed as the annotation’s visual manifestation on the page.

Extends

Constructors

Constructor

new FreeTextAnnotation(options): FreeTextAnnotation

Creates a new FreeTextAnnotation instance.

Parameters

options

FreeTextAnnotationOptions

Options used to initialize annotation.

Returns

FreeTextAnnotation

Overrides

MarkupAnnotation.constructor

Accessors

author

Get Signature

get author(): string

The author.

Returns

string

Set Signature

set author(author): void

Parameters
author

string

Returns

void

Inherited from

MarkupAnnotation.author


backgroundColor

Get Signature

get backgroundColor(): string

Background color for the annotation.

Returns

string

Set Signature

set backgroundColor(color): void

Parameters
color

string

Returns

void


blendMode

Get Signature

get blendMode(): BlendMode

Experimental

blend mode

Returns

BlendMode

Set Signature

set blendMode(blendMode): void

Parameters
blendMode

BlendMode

Returns

void

Inherited from

MarkupAnnotation.blendMode


boundingBox

Get Signature

get boundingBox(): Rectangle<PdfPoint>

Represents the bounding box of the annotation, which defines its position and size on the page. The bounding box is specified as a Rectangle of PdfPoint coordinates.

Returns

Rectangle<PdfPoint>

Set Signature

set boundingBox(rectangle): void

Parameters
rectangle

Rectangle<PdfPoint>

Returns

void

Inherited from

MarkupAnnotation.boundingBox


content

Get Signature

get content(): string

Text that shall be displayed for the annotation or, if this type of annotation does not display text, an alternative description of the annotation’s contents in human-readable form.

Returns

string

Set Signature

set content(content): void

Text that shall be displayed for the annotation or, if this type of annotation does not display text, an alternative description of the annotation’s contents in human-readable form.

Parameters
content

string

Returns

void

Overrides

MarkupAnnotation.content


creationDate

Get Signature

get creationDate(): Date

The date and time when the annotation was created.

This property retrieves the creation date from the annotation and converts it to a JavaScript Date object.

Returns

Date

The creation date as a JavaScript Date object, or null if no creation date is available in the annotation.

Inherited from

MarkupAnnotation.creationDate


dateModified

Get Signature

get dateModified(): Date

Experimental

The date and time when the annotation was most recently modified.

Returns

Date

Set Signature

set dateModified(date): void

Parameters
date

Date

Returns

void

Inherited from

MarkupAnnotation.dateModified


hasChanges

Get Signature

get hasChanges(): boolean

Experimental

Indicates if the annotation has been changed since the document was opened

Returns

boolean

Inherited from

MarkupAnnotation.hasChanges


hidden

Get Signature

get hidden(): boolean

If set to true, the annotation will not be displayed or printed, and it will not allow interaction with the user.

Returns

boolean

Set Signature

set hidden(hidden): void

Parameters
hidden

boolean

Returns

void

Inherited from

MarkupAnnotation.hidden


id

Get Signature

get id(): void

Experimental

A unique identifier for the annotation.

Returns

void

Inherited from

MarkupAnnotation.id


interactive

Get Signature

get interactive(): boolean

Specifies whether the annotation allows user interaction.

Returns

boolean

Set Signature

set interactive(interactive): void

Parameters
interactive

boolean

Returns

void

Inherited from

MarkupAnnotation.interactive


isAdded

Get Signature

get isAdded(): boolean

Experimental

Indicates whether the annotation was added to a page

Returns

boolean

Inherited from

MarkupAnnotation.isAdded


isMaintainingAspectRatio

Get Signature

get isMaintainingAspectRatio(): boolean

Pdf.Annotations.Annotation.isMaintainingAspectRatio

Returns

boolean

Overrides

MarkupAnnotation.isMaintainingAspectRatio


isMarkupAnnotation

Get Signature

get isMarkupAnnotation(): boolean

Pdf.Annotations.Annotation.isMarkupAnnotation

Returns

boolean

Inherited from

MarkupAnnotation.isMarkupAnnotation


isModified

Get Signature

get isModified(): boolean

Experimental

Indicates if the annotation has changes that have not yet been saved to the document

Returns

boolean

Inherited from

MarkupAnnotation.isModified


isMoveable

Get Signature

get isMoveable(): boolean

Pdf.Annotations.Annotation.isMoveable

Returns

boolean

Overrides

MarkupAnnotation.isMoveable


isResizable

Get Signature

get isResizable(): boolean

Pdf.Annotations.Annotation.isResizable

Returns

boolean

Overrides

MarkupAnnotation.isResizable


isRotatable

Get Signature

get isRotatable(): boolean

Pdf.Annotations.Annotation.isRotatable

Returns

boolean

Overrides

MarkupAnnotation.isRotatable


isSelectable

Get Signature

get isSelectable(): boolean

Pdf.Annotations.Annotation.isSelectable

Returns

boolean

Overrides

MarkupAnnotation.isSelectable


isWidgetAnnotation

Get Signature

get isWidgetAnnotation(): boolean

Pdf.Annotations.Annotation.isWidgetAnnotation

Returns

boolean

Inherited from

MarkupAnnotation.isWidgetAnnotation


locked

Get Signature

get locked(): AnnotationLockedState

Represents the locked state of the annotation.

Returns

AnnotationLockedState

Set Signature

set locked(locked): void

Parameters
locked

AnnotationLockedState

Returns

void

Inherited from

MarkupAnnotation.locked


modificationDate

Get Signature

get modificationDate(): Date

The date and time when the annotation was last modified.

This property will retrieve the modification date from the annotation and convert it to a JavaScript Date object.

Returns

Date

The modification date as a JavaScript Date object, or null if no modification date is available in the annotation.

Inherited from

MarkupAnnotation.modificationDate


opacity

Get Signature

get opacity(): number

Gets the annotation opacity.

Returns

number

Set Signature

set opacity(o): void

Sets the annotation opacity.

Parameters
o

number

Returns

void

Inherited from

MarkupAnnotation.opacity


page

Get Signature

get page(): Page

Page in which the annotation is embedded.

Returns

Page

Set Signature

set page(page): void

Set the page in which the annotation is embedded.

Parameters
page

Page

The page to set as the annotation’s page.

Returns

void

Inherited from

MarkupAnnotation.page


pageNumber

Get Signature

get pageNumber(): number

Experimental

Number of the page in which the annotation is embedded.

Returns

number

Inherited from

MarkupAnnotation.pageNumber


privateData

Get Signature

get privateData(): object

Experimental

Custom data to be stored with the annotation

Returns

object

Set Signature

set privateData(privateData): void

Parameters
privateData

object

Returns

void

Inherited from

MarkupAnnotation.privateData


renderProperties

Get Signature

get renderProperties(): AnnotationRenderProperties

Object which encapsulates the rendering properties of a PDF annotation, providing a set of flags that control its visibility, interactivity, and other rendering behaviors.

Returns

AnnotationRenderProperties

Set Signature

set renderProperties(v): void

Parameters
v

AnnotationRenderProperties

Returns

void

Inherited from

MarkupAnnotation.renderProperties


richText

Get Signature

get richText(): string

A rich text string that shall be displayed in the popup window when the annotation is opened.

Returns

string

Set Signature

set richText(richText): void

Parameters
richText

string

Returns

void


rotation

Get Signature

get rotation(): Rotation

Rotation of the annotation

Returns

Rotation

Set Signature

set rotation(rotation): void

Parameters
rotation

Rotation

Returns

void


source

Get Signature

get source(): void

Experimental

Tag that identifies the source the annotation is coming from, if the source is an input PDF or an input FDF. Newly created annotations always return null.

Returns

void

Inherited from

MarkupAnnotation.source


subject

Get Signature

get subject(): string

The subject.

Returns

string

Set Signature

set subject(subject): void

Parameters
subject

string

Returns

void

Inherited from

MarkupAnnotation.subject


type

Get Signature

get type(): AnnotationType

Pdf.Annotations.Annotation.type

Returns

AnnotationType

Overrides

MarkupAnnotation.type

Methods

dispose()

dispose(): void

Disposes of the object, releasing any resources it holds.

The dispose method is responsible for performing cleanup operations and releasing any resources acquired by the object. Once an object is disposed, it should not be used, and attempts to do so may result in undefined behavior.

Returns

void

Inherited from

MarkupAnnotation.dispose