[]
        
(Showing Draft Content)

WatermarkAnnotation

DsPdfJS API v9.1.0


DsPdfJS API / WatermarkAnnotation

Class: WatermarkAnnotation

Defines a graphics that are expected to be printed at a fixed size and position on a page, regardless of the dimensions of the printed page.

Extends

Constructors

Constructor

new WatermarkAnnotation(om): WatermarkAnnotation

Creates a new WatermarkAnnotation.

Parameters

om

ObjectManager

ObjectManager that controls the lifetime of the WatermarkAnnotation.

Returns

WatermarkAnnotation

Overrides

AnnotationBase.constructor

Constructor

new WatermarkAnnotation(): WatermarkAnnotation

Creates a new WatermarkAnnotation.

Returns

WatermarkAnnotation

Overrides

AnnotationBase.constructor

Accessors

contents

Get Signature

get contents(): string | null

Gets or sets the text to be displayed for the annotation or, if this type of annotation does not display text, an alternate description of the annotation's contents in human-readable form. In either case, this text is useful when extracting the document's contents in support of accessibility to users with disabilities or for other purposes.

Returns

string | null

Set Signature

set contents(value): void

Gets or sets the text to be displayed for the annotation or, if this type of annotation does not display text, an alternate description of the annotation's contents in human-readable form. In either case, this text is useful when extracting the document's contents in support of accessibility to users with disabilities or for other purposes.

Parameters
value

string | null

Returns

void

Inherited from

AnnotationBase.contents


doc

Get Signature

get doc(): PdfDocument | null

Gets the PdfDocument owning this annotation.

Returns

PdfDocument | null

Inherited from

AnnotationBase.doc


flags

Get Signature

get flags(): AnnotationFlags

Gets or sets the flags specifying various characteristics of the annotation.

Returns

AnnotationFlags

Set Signature

set flags(value): void

Gets or sets the flags specifying various characteristics of the annotation.

Parameters
value

AnnotationFlags

Returns

void

Inherited from

AnnotationBase.flags


horzTranslate

Get Signature

get horzTranslate(): number

Gets or sets the amount to translate the associated content horizontally, as a percentage of the width of the target media (or if unknown, the width of the page's MediaBox). 1.0 represents 100% and 0.0 represents 0%. Negative values are not recommended, since they may cause content to be drawn off the page.

Returns

number

Set Signature

set horzTranslate(value): void

Gets or sets the amount to translate the associated content horizontally, as a percentage of the width of the target media (or if unknown, the width of the page's MediaBox). 1.0 represents 100% and 0.0 represents 0%. Negative values are not recommended, since they may cause content to be drawn off the page.

Parameters
value

number

Returns

void


id

Get Signature

get id(): number

Gets the reference to the object.

Returns

number

Inherited from

AnnotationBase.id


image

Get Signature

get image(): ImageOrBitmap | null

Gets or sets the image if WatermarkAnnotation, if both 'text' and 'image' are specified then 'image' is used as watermark content.

Returns

ImageOrBitmap | null

Set Signature

set image(image): void

Gets or sets the image if WatermarkAnnotation, if both 'text' and 'image' are specified then 'image' is used as watermark content.

Parameters
image

ImageOrBitmap | null

Returns

void


locked

Get Signature

get locked(): boolean

Gets or sets a value indicating whether the annotation can be deleted or its properties (including position and size) can be modified by the user. However, this flag does not restrict changes to the annotation's contents, such as the value of a form field.

Returns

boolean

Set Signature

set locked(value): void

Gets or sets a value indicating whether the annotation can be deleted or its properties (including position and size) can be modified by the user. However, this flag does not restrict changes to the annotation's contents, such as the value of a form field.

Parameters
value

boolean

Returns

void

Inherited from

AnnotationBase.locked


lockedContents

Get Signature

get lockedContents(): boolean

Gets or sets a value indicating whether the contents of the annotation can be modified by the user. This flag does not restrict deletion of the annotation or changes to other annotation properties, such as position and size.

Returns

boolean

Set Signature

set lockedContents(value): void

Gets or sets a value indicating whether the contents of the annotation can be modified by the user. This flag does not restrict deletion of the annotation or changes to other annotation properties, such as position and size.

Parameters
value

boolean

Returns

void

Inherited from

AnnotationBase.lockedContents


matrix

Get Signature

get matrix(): number[]

Gets or sets the matrix used to transform the annotation's rectangle before rendering.

Returns

number[]

Set Signature

set matrix(matrix): void

Gets or sets the matrix used to transform the annotation's rectangle before rendering.

Parameters
matrix

number[]

Returns

void


modifiedDate

Get Signature

get modifiedDate(): PdfDateTime | null

Gets or sets the date and time when the annotation was modified.

Returns

PdfDateTime | null

Set Signature

set modifiedDate(value): void

Gets or sets the date and time when the annotation was modified.

Parameters
value

PdfDateTime | null

Returns

void

Inherited from

AnnotationBase.modifiedDate


name

Get Signature

get name(): string | null

Gets or sets the annotation name, a text string uniquely identifying it among all annotations on its page.

Returns

string | null

Set Signature

set name(value): void

Gets or sets the annotation name, a text string uniquely identifying it among all annotations on its page.

Parameters
value

string | null

Returns

void

Inherited from

AnnotationBase.name


om

Get Signature

get om(): ObjectManager

Gets the owner ObjectManager instance.

Returns

ObjectManager

Inherited from

AnnotationBase.om


page

Get Signature

get page(): PdfPage | null

Gets or sets the PdfPage that contains this annotation. Note that an annotation may be referenced by several pages. In that case this property returns the first element in the pages collection. When setting this property, the following applies: If the new value is null, this annotation is removed from all pages. Otherwise, this annotation is assigned exclusively to the specified page.

Returns

PdfPage | null

Set Signature

set page(value): void

Gets or sets the PdfPage that contains this annotation. Note that an annotation may be referenced by several pages. In that case this property returns the first element in the pages collection. When setting this property, the following applies: If the new value is null, this annotation is removed from all pages. Otherwise, this annotation is assigned exclusively to the specified page.

Parameters
value

PdfPage | null

Returns

void

Inherited from

UnknownAnnotation.page


pages

Get Signature

get pages(): AnnotationPagesCollection

Gets the list of pages that reference this annotation.

Returns

AnnotationPagesCollection

Inherited from

AnnotationBase.pages


pdfRect

Get Signature

get pdfRect(): Rect

Gets or sets the rectangle that defines the location and size of the annotation on a page in PDF user space coordinates. The positive X axis extends horizontally to the right, and the positive Y axis extends vertically upward, with the origin usually in the lower left corner of the page.

See

rect

Returns

Rect

Set Signature

set pdfRect(value): void

Gets or sets the rectangle that defines the location and size of the annotation on a page in PDF user space coordinates. The positive X axis extends horizontally to the right, and the positive Y axis extends vertically upward, with the origin usually in the lower left corner of the page.

See

rect

Parameters
value

Rect

Returns

void

Inherited from

AnnotationBase.pdfRect


rect

Get Signature

get rect(): Rect

Gets or sets the rectangle that defines the location and size of the annotation on a page. The coordinates of the rectangle are relative to the upper left corner of the page's media box, with the Y (vertical) coordinates increasing from top to bottom. Note that if the annotation is associated with more than one page, the media box of the first of those pages is used to calculate the rectangle's location.

Returns

Rect

Set Signature

set rect(value): void

Gets or sets the rectangle that defines the location and size of the annotation on a page. The coordinates of the rectangle are relative to the upper left corner of the page's media box, with the Y (vertical) coordinates increasing from top to bottom. Note that if the annotation is associated with more than one page, the media box of the first of those pages is used to calculate the rectangle's location.

Parameters
value

Rect

Returns

void

Inherited from

UnknownAnnotation.rect


text

Get Signature

get text(): string

Gets or sets the text of WatermarkAnnotation, if both 'text' and 'image' are specified then 'image' is used as watermark content.

Returns

string

Set Signature

set text(value): void

Gets or sets the text of WatermarkAnnotation, if both 'text' and 'image' are specified then 'image' is used as watermark content.

Parameters
value

string

Returns

void


textFormat

Set Signature

set textFormat(value): void

Sets the Format object that specifies the formatting of the annotation's text.

Note that this object itself is not persisted in the PDF, just its properties are used to generate the appearance of this watermark annotation.

Parameters
value

Format | FormatProperties | null

Returns

void


vertTranslate

Get Signature

get vertTranslate(): number

Gets or sets the amount to translate the associated content vertically, as a percentage of the height of the target media (or if unknown, the height of the page's MediaBox). 1.0 represents 100% and 0.0 represents 0%. Negative values are not recommended, since they may cause content to be drawn off the page.

Returns

number

Set Signature

set vertTranslate(value): void

Gets or sets the amount to translate the associated content vertically, as a percentage of the height of the target media (or if unknown, the height of the page's MediaBox). 1.0 represents 100% and 0.0 represents 0%. Negative values are not recommended, since they may cause content to be drawn off the page.

Parameters
value

number

Returns

void

Methods

free()

free(): void

Detaches the object from the ObjectManager and deallocates its memory, if possible.

Returns

void

Inherited from

AnnotationBase.free


rebind()

rebind(omTo): void

Rebinds the object from the current ObjectManager to the specified one.

Parameters

omTo

ObjectManager

The new ObjectManager for the object.

Returns

void

Inherited from

AnnotationBase.rebind


removeAppearance()

removeAppearance(): void

Removes all appearance streams associated with the current annotation, and disables generation of appearance steams for this annotation when the document is saved.

Note that if any property affecting the annotation's appearance 'rect' is then changed, the appearance streams will be regenerated. So this method would usually be called after initializing all annotation's properties.

Returns

void

Inherited from

AnnotationBase.removeAppearance


resetAppearance()

resetAppearance(): void

Forces regeneration of the annotation's appearance streams next time the document is saved.

Returns

void

Inherited from

AnnotationBase.resetAppearance