Class: SquareAnnot

PDFNet. SquareAnnot


new SquareAnnot()

Square annotation is used to display a rectangle on the page. When opened, a square annotation can display a pop-up window containing the text of the associated note. The rectangle may be inscribed and possibly padded within the annotation rectangle defined by the annotation dictionary's Rect entry.

Methods


<static> create(doc, pos)

Creates a new Square annotation in the specified document.

Parameters:
Name Type Description
doc SDFDoc

A document to which the annotation is added.

pos rect

A rectangle specifying the annotation's bounds, in user space coordinates.

Returns:

A promise that resolves to a newly created blank Square annotation.

Type
SquareAnnot

<static> createFromAnnot(ann)

creates a Square annotation and initializes it using given annotation object.

Parameters:
Name Type Description
ann Annot

Annot object used to initialize the Square annotation.

Returns:

A promise that resolves to an object of type: "SquareAnnot"

Type
SquareAnnot

<static> createFromObj(d)

creates an Square annotation and initializes it using given Cos/SDF object.

Parameters:
Name Type Description
d Obj

The Cos/SDF object to initialze the annotation with.

Returns:

A promise that resolves to an object of type: "SquareAnnot"

Type
SquareAnnot

getContentRect()

Returns:

A promise that resolves to an object of type: "rect"

Type
rect

getInteriorColor()

Returns:

A promise that resolves to an object of type: "colorpt"

Type
colorpt

getInteriorColorCompNum()

Returns:

A promise that resolves to an object of type: "number"

Type
number

getPadding()

Returns:

A promise that resolves to an object of type: "rect"

Type
rect

setContentRect(cr)

Parameters:
Name Type Description
cr rect

setInteriorColor(col, numcomp)

Parameters:
Name Type Description
col colorpt
numcomp number

setInteriorColorDefault(col)

Parameters:
Name Type Description
col colorpt

setPadding(cr)

Parameters:
Name Type Description
cr rect