Class: MarkupAnnot

PDFNet. MarkupAnnot


new MarkupAnnot()

Markup is a base class for a number of annotations types that are used to mark up PDF documents. These annotations have text that appears as part of the annotation and may be displayed in other ways by a conforming reader, such as in a Comments pane. Markup annotations may be divided into the following groups:

  • Free text annotations display text directly on the page. The annotation's Contents entry specifies the displayed text.
  • Most other markup annotations have an associated pop-up window that may contain text. The annotation's Contents entry specifies the text that shall be displayed when the pop-up window is opened. These include text, line, square, circle, polygon, polyline, highlight,underline, squiggly-underline, strikeout, rubber stamp, caret, ink, and file attachment annotations.
  • Sound annotations do not have a pop-up window but may also have associated text specified by the Contents entry.
  • A subset of markup annotations are intended to markup text of a document (e.g. highlight, strikeout, jagged, underline) and they are derived from TextMarkup base class.

Methods


<static> createFromAnnot(ann)

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

Parameters:
Name Type Description
ann PDFNet.Annot

Annot object used to initialize the Markup annotation.

Returns:

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

Type
PDFNet.MarkupAnnot

<static> createFromObj(d)

creates a markup annotation and initializes it using given Cos/SDF object.

Parameters:
Name Type Description
d PDFNet.Obj

The Cos/SDF object to initialze the annotation with.

Returns:

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

Type
PDFNet.MarkupAnnot

getBorderEffect()

Returns:

A promise that resolves to the border effect of the markup annotation. Default value: e_None.

Beginning with PDF 1.5, some annotations (square, circle, and polygon) may have a 'BE' entry, which is a border effect dictionary that specifies an effect that shall be applied to the border of the annotations. Beginning with PDF 1.6, the free text annotation may also have a BE entry.

Type
number
Example
Return value enum:
<pre>
PDFNet.MarkupAnnot.BorderEffect = {
	e_None : 0
	e_Cloudy : 1
}
</pre>

getBorderEffectIntensity()

Returns:

A promise that resolves to a number describing the intensity of the border effect, in the range 0 to 2.

Beginning with PDF 1.5, some annotations (square, circle, and polygon) may have a 'BE' entry, which is a border effect dictionary that specifies an effect that shall be applied to the border of the annotations. Beginning with PDF 1.6, the free text annotation may also have a BE entry.

Type
number

getContentRect()

Returns the inner bounding rectangle of the Markup annotation.

Returns:

A promise that resolves to a rectangle specifying the region where content should be displayed.

Type
PDFNet.rect

getCreationDates()

Returns:

A promise that resolves to the creation date for the markup annotation.

Type
PDFNet.date

getInteriorColor()

Returns the interior color of the annotation.

Returns:

A promise that resolves to a ColorPt object that denotes the color of the annotation.

Type
PDFNet.colorpt

getInteriorColorCompNum()

Returns the number indicating the interior color space of the annotation.

Returns:

A promise that resolves to an integer indicating the number of channels forming the color space. 3 corresponds to RGB, 4 corresponds to CMYK, and 1 corresponds to Gray. If the interior is transparent, the return value is 0.

Type
number

getOpacity()

Returns:

A promise that resolves to the opacity value.
Default value: 1.0.

Type
number

getPadding()

Returns the rectangle difference between overall annotation rectangle and content rectangle.

See:
  • GetContentRect()
Returns:

A promise that resolves to a set of four numbers represented as a Rect struct.

Type
PDFNet.rect

getPopup()

Returns the Popup object associated with this markup annotation.

Returns:

A promise that resolves to a Popup object that is associated with this markup annotation.

Type
PDFNet.Annot

getSubject()

Returns the subject of the Markup annotation. (PDF 1.5)

Returns:

A promise that resolves to a string representing the subject of the Markup annotation.

Type
string

getTitle()

Returns the title of the markup annotation.

Returns:

A promise that resolves to a string representing the title of the markup annotation, or null is the title is not specified.

Type
string

setBorderEffect(effect)

Sets the border effect of the markup annotation. (Optional; PDF 1.5 )

Beginning with PDF 1.5, some annotations (square, circle, and polygon) may have a 'BE' entry, which is a border effect dictionary that specifies an effect that shall be applied to the border of the annotations. Beginning with PDF 1.6, the free text annotation may also have a BE entry.

Parameters:
Name Type Description
effect number/enum
PDFNet.MarkupAnnot.BorderEffect = {
	e_None : 0
	e_Cloudy : 1
}

An entry from the enum "BorderEffect" that represents the border effect of the Markup annotation. Default value: e_None.


setBorderEffectIntensity(intensity)

sets the border effect intensity of the markup annotation. (Optional; valid only if Border effect is Cloudy)

Beginning with PDF 1.5, some annotations (square, circle, and polygon) may have a 'BE' entry, which is a border effect dictionary that specifies an effect that shall be applied to the border of the annotations. Beginning with PDF 1.6, the free text annotation may also have a BE entry.

Parameters:
Name Type Description
intensity number

A number describing the intensity of the border effect, in the range 0 (which is default) to 2.


setContentRect(cr)

sets the inner bounding rectangle of the Markup annotation. (Optional)

Parameters:
Name Type Description
cr PDFNet.rect

A Rect struct to be assign to the 'RD' entry of the annotation dictionary.


setCreationDates(dt)

Sets the creation date for the markup annotation. (Optional; PDF 1.5 )

Parameters:
Name Type Description
dt PDFNet.date

A Date object indicating the date the markup annotation is created.


setInteriorColor(c, CompNum)

Sets the interior color of the Markup annotation.

Parameters:
Name Type Description
c PDFNet.colorpt

A ColorPt object that denotes the color of the Markup annotation.

CompNum number

An integer indicating the number of channels forming the color space used. It also defines the length of the array to be allocated for storing the entries of c.


setInteriorColorRGB(col)

Parameters:
Name Type Description
col PDFNet.ColorPt

setOpacity(op)

Sets the opacity value for the annotation. (Optional; PDF 1.4 )

Parameters:
Name Type Description
op number

A number indicating the Markup annotation's opacity value. Default value: 1.0.


setPadding(rd)

sets the rectangle difference between overall annotation rectangle and content rectangle. (Optional)

Parameters:
Name Type Description
rd PDFNet.rect

A set of four numbers represented as a Rect struct

See:
  • GetContentRect()

setPopup(ppup)

Sets the Popup object associated with this markup annotation. (Optional; PDF 1.3 )

Parameters:
Name Type Description
ppup PDFNet.Annot

A Popup object that is associated with this markup annotation.


setSubject(contents)

Sets subject of the Markup annotation. (Optional; PDF 1.5 )

Parameters:
Name Type Description
contents string

A string representing the subject of the Markup annotation.


setTitle(title)

sets the title of the markup annotation. (Optional; PDF 1.1)

Parameters:
Name Type Description
title string

A string.


setTitleUString(title)

sets the title of the markup annotation. (Optional; PDF 1.1)

Parameters:
Name Type Description
title string

A string.