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.
Extends
- Annot
Members
-
<static> BorderEffect
-
Properties:
Name Type Description e_None
number e_Cloudy
number
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: "PDFNet.MarkupAnnot"- Type
- Promise.<PDFNet.MarkupAnnot>
-
<static> createFromObj( [d])
-
creates a markup annotation and initializes it using given Cos/SDF object.
Parameters:
Name Type Argument Description d
PDFNet.Obj <optional>
The Cos/SDF object to initialze the annotation with. Returns:
A promise that resolves to an object of type: "PDFNet.MarkupAnnot"- Type
- Promise.<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
- Promise.<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
- Promise.<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
- Promise.<PDFNet.Rect>
-
getCreationDates()
-
Returns:
A promise that resolves to the creation date for the markup annotation.- Type
- Promise.<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
- Promise.<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
- Promise.<number>
-
getOpacity()
-
Returns:
A promise that resolves to the opacity value. Default value: 1.0.- Type
- Promise.<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
- Promise.<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
- Promise.<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
- Promise.<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
- Promise.<string>
-
rotateAppearance(angle)
-
Rotates the appearance of the Markup annotation.
Parameters:
Name Type Description angle
number The new rotation Returns:
- Type
- Promise.<void>
-
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 Argument Description effect
number <optional>
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.Returns:
- Type
- Promise.<void>
-
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 Argument Description intensity
number <optional>
A number describing the intensity of the border effect, in the range 0 (which is default) to 2. Returns:
- Type
- Promise.<void>
-
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. Returns:
- Type
- Promise.<void>
-
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. Returns:
- Type
- Promise.<void>
-
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. Returns:
- Type
- Promise.<void>
-
setInteriorColorRGB(col)
-
Parameters:
Name Type Description col
PDFNet.ColorPt Returns:
- Type
- Promise.<void>
-
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. Returns:
- Type
- Promise.<void>
-
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()
Returns:
- Type
- Promise.<void>
-
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. Returns:
- Type
- Promise.<void>
-
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. Returns:
- Type
- Promise.<void>
-
setTitle(title)
-
sets the title of the markup annotation. (Optional; PDF 1.1)
Parameters:
Name Type Description title
string A string. Returns:
- Type
- Promise.<void>
-
setTitleUString(title)
-
sets the title of the markup annotation. (Optional; PDF 1.1)
Parameters:
Name Type Description title
string A string. Returns:
- Type
- Promise.<void>