Skip to main content
Version: Version 5 beta

Class: TextMarkupAnnotation

Experimental

Base class for text markup annotations

Extends

Constructors

new TextMarkupAnnotation()

new TextMarkupAnnotation(options): TextMarkupAnnotation

Experimental

Parameters

options: TextMarkupAnnotationOptions

Options used to initialize annotation.

Returns

TextMarkupAnnotation

Overrides

MarkupAnnotation.constructor

Accessors

__annotation

get __annotation(): TextMarkupAnnotation

Experimental

set __annotation(v): void

Experimental

Parameters

v: TextMarkupAnnotation

Returns

TextMarkupAnnotation

Overrides

MarkupAnnotation.__annotation


author

get author(): string

Experimental

The author.

set author(author): void

Experimental

Parameters

author: string

Returns

string

Inherited from

MarkupAnnotation.author


blendMode

get blendMode(): BlendMode

Experimental

blend mode

set blendMode(blendMode): void

Experimental

Parameters

blendMode: BlendMode

Returns

BlendMode

Inherited from

MarkupAnnotation.blendMode


boundingBox

get boundingBox(): Rectangle<PdfPoint>

Experimental

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.

set boundingBox(rectangle): void

Experimental

Parameters

rectangle: Rectangle<PdfPoint>

Returns

Rectangle<PdfPoint>

Inherited from

MarkupAnnotation.boundingBox


content

get content(): string

Experimental

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.

set content(content): void

Experimental

Parameters

content: string

Returns

string

Inherited from

MarkupAnnotation.content


dateCreated

get dateCreated(): void

Experimental

Date and time the annotation was created.

Returns

void

Inherited from

MarkupAnnotation.dateCreated


dateModified

get dateModified(): Date

Experimental

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

set dateModified(date): void

Experimental

Parameters

date: Date

Returns

Date

Inherited from

MarkupAnnotation.dateModified


fillColor

get fillColor(): RgbColor

Experimental

Retrieves the fill color used in the annotation.

set fillColor(v): void

Experimental

Sets the fill color for the annotation.

Parameters

v: RgbColor

The new RgbColor to apply to the annotation.

Returns

RgbColor

The RgbColor representing the annotation's fill color.


hasChanges

get hasChanges(): boolean

Experimental

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

Returns

boolean

Inherited from

MarkupAnnotation.hasChanges


hidden

get hidden(): boolean

Experimental

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

set hidden(hidden): void

Experimental

Parameters

hidden: boolean

Returns

boolean

Inherited from

MarkupAnnotation.hidden


id

get id(): void

Experimental

A unique identifier for the annotation.

Returns

void

Inherited from

MarkupAnnotation.id


interactive

get interactive(): boolean

Experimental

Specifies whether the annotation allows user interaction.

set interactive(interactive): void

Experimental

Parameters

interactive: boolean

Returns

boolean

Inherited from

MarkupAnnotation.interactive


isAdded

get isAdded(): boolean

Experimental

Indicates whether the annotation was added to a page

Returns

boolean

Inherited from

MarkupAnnotation.isAdded


isMaintainingAspectRatio

get isMaintainingAspectRatio(): boolean

Experimental

Indicates if the annotation is maintaining its aspect ratio

Returns

boolean

Overrides

MarkupAnnotation.isMaintainingAspectRatio


isMarkupAnnotation

get isMarkupAnnotation(): boolean

Experimental

Indicates if the annotation is a markup annotation

Returns

boolean

Inherited from

MarkupAnnotation.isMarkupAnnotation


isModified

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 isMoveable(): boolean

Experimental

Indicates if the annotation can be moved by the user

Returns

boolean

Overrides

MarkupAnnotation.isMoveable


isResizable

get isResizable(): boolean

Experimental

Indicates if the annotation can be resized by the user

Returns

boolean

Overrides

MarkupAnnotation.isResizable


isRotatable

get isRotatable(): boolean

Experimental

Indicates if the annotation can be rotated by the user

Returns

boolean

Overrides

MarkupAnnotation.isRotatable


isSelectable

get isSelectable(): boolean

Experimental

Indicates if the annotation can be selected by the user

Returns

boolean

Overrides

MarkupAnnotation.isSelectable


isWidgetAnnotation

get isWidgetAnnotation(): boolean

Experimental

Indicates if the annotation is a widget annotation

Returns

boolean

Inherited from

MarkupAnnotation.isWidgetAnnotation


locked

get locked(): AnnotationLockedState

Experimental

Represents the locked state of the annotation.

set locked(locked): void

Experimental

Parameters

locked: AnnotationLockedState

Returns

AnnotationLockedState

Inherited from

MarkupAnnotation.locked


opacity

get opacity(): number

Experimental

Annotation opacity

set opacity(opacity): void

Experimental

Parameters

opacity: number

Returns

number

Inherited from

MarkupAnnotation.opacity


page

get page(): Page

Experimental

Page in which the annotation is embedded.

set page(page): void

Experimental

Set the page in which the annotation is embedded.

Parameters

page: Page

The page to set as the annotation's page.

Returns

Page

Inherited from

MarkupAnnotation.page


pageNumber

get pageNumber(): number

Experimental

Number of the page in which the annotation is embedded.

Returns

number

Inherited from

MarkupAnnotation.pageNumber


privateData

get privateData(): object

Experimental

Custom data to be stored with the annotation

set privateData(privateData): void

Experimental

Parameters

privateData: object

Returns

object

Inherited from

MarkupAnnotation.privateData


renderProperties

get renderProperties(): AnnotationRenderProperties

Experimental

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

set renderProperties(v): void

Experimental

Parameters

v: AnnotationRenderProperties

Returns

AnnotationRenderProperties

Inherited from

MarkupAnnotation.renderProperties


source

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 subject(): string

Experimental

The subject.

set subject(subject): void

Experimental

Parameters

subject: string

Returns

string

Inherited from

MarkupAnnotation.subject


subtype

get subtype(): TextMarkupType

Experimental

Retrieves the type of markup applied by this annotation.

Returns

TextMarkupType

The TextMarkupType representing how the text is marked, such as highlight, underline, strikethrough, or squiggly.


textMarkupArea

get textMarkupArea(): Quadrilateral<PdfPoint>[]

Experimental

Retrieves the area marked by this annotation.

This represents the set of quadrilateral regions that highlight or mark portions of text within the document.

Returns

Quadrilateral<PdfPoint>[]

An array of Quadrilateral defining the marked-up area.


type

get type(): AnnotationType

Experimental

The PDF annotation type

Returns

AnnotationType

Overrides

MarkupAnnotation.type


underlyingText

get underlyingText(): string

Experimental

Retrieves the text associated with the text markup annotation as a string.

Remarks

This method provides a convenient way to access the text marked by the annotation, but it does not directly originate from the annotation object within the PDF structure. Due to potential complexities such as overlapping texts or watermarks, the returned string might not always precisely match the visually selected content.

Returns

string

The text associated with the annotation.

Methods

dispose()

dispose(): void

Experimental

Returns

void

Inherited from

MarkupAnnotation.dispose