FoxitPDFSDKforWeb v10.0.0
Foxit PDF SDK for Web
Markup Class Reference

Markup annot object. More...

Inheritance diagram for Markup:
Annot Caret Circle FileAttachment FreeText Ink Line Note Polygon PolyLine Redact Sound Square Stamp TextMarkup

Public Member Functions

 addMarkedState (stateName)
 Add marked state with specific name [Support in Server] More...
 
 addReply (content)
 Add a new reply to the end of reply list. [Support in Server] More...
 
 addReviewState (stateName)
 Add review state with specific name. [Support in Server] More...
 
 addRichText (datas)
 Add new text data with rich styles to the end. Note: Now, only support Freetext annotation. if current annotation is a freetext and its intent is "FreeTextTypewriter", text aligment of input style will be set to all rich text strings of current freetext annotation. More...
 
 exportToJSON ()
 Export annotation to a json object. [Support in Server] Override Annot::exportToJSON. More...
 
 getCreateDateTime ()
 Get creation date time. [Support in Server] More...
 
 getGroupElements ()
 Get the group annotations which own current annotation. [Support in Server] More...
 
 getGroupHeader ()
 Get the header annotation (as primary annotation) of the group that current markup annotation belongs to. [Support in Server] More...
 
 getIntent ()
 Get intent name.
Following annotation types have predefined intent name: More...
 
 getMarkedState (index)
 Get a state annotation by index. state model is marked [Support in Server] More...
 
 getMarkedStateCount ()
 Get the count of state annotations. [Support in Server] More...
 
 getMarkedStates ()
 Get all state annotation. state model is marked [Support in Server] More...
 
 getOpacity ()
 Get opacity value.
This property has effect on markup annotation's appearance. [Support in Server] More...
 
 getPopup ()
 Get annotation's popup. [Support in Server] More...
 
 getReplies ()
 Get all replies [Support in Server] More...
 
 getReply (index)
 Get a reply annot by index. [Support in Server] More...
 
 getReplyCount ()
 Count all replies. [Support in Server] More...
 
 getReviewState (index)
 Get a state annotation by index. state model is review [Support in Server] More...
 
 getReviewStateCount ()
 Get the count of state annotations. [Support in Server]
When state model is review, the markup annotation can have several state annotations in a chain: first state annotation refers to the markup annotation, second state annotation refers to the first state annotation, etc. Just like this: markup annotation <– reviewed state1 <– reviewed state2 ... More...
 
 getReviewStates ()
 Get all state annotation. state model is review [Support in Server] More...
 
 getRichText ()
 Get the rich text data, including rich text strings and styles. Note: Now, only support Freetext annotation. if current annotation is a freetext and its intent is "FreeTextTypewriter", text aligment of input style will be set to all rich text strings of current freetext annotation. More...
 
 getSubject ()
 Get subject string. [Support in Server] More...
 
 getTitle ()
 Get title string. [Support in Server] More...
 
 insertRichText (datas)
 Insert rich text string to the place which is specified by indexs. More...
 
 isGrouped ()
 Check whether current markup annotation is in a group or not. [Support in Server] More...
 
 isGroupHeader ()
 Check whether current markup annotation is a group header annotation. [Support in Server] More...
 
 removeAllStateAnnots ()
 Remove all sate from this markup annotation. [Support in Server] More...
 
 removeRichText (indexes)
 Remove a rich text string specified by index. More...
 
 setContent (content)
 Set markup annotation's contents. [Support in Server] More...
 
 setCreateDateTime (date)
 Set creation date time. [Support in Server] More...
 
 setIntent (intent)
 Set annotaions's intent. More...
 
 setOpacity (opacity)
 Set opacity value. [Support in Server] More...
 
 setRichText (datas)
 Set the rich text data with rich styles to the place which is specified by indexes. Note: Now, only support Freetext annotation. if current annotation is a freetext and its intent is "FreeTextTypewriter", text alignment of input style will be set to all rich text strings of current freetext annotation. More...
 
 setSubject (subject)
 Set subject string. [Support in Server] More...
 
 setTitle (title)
 Set title string. [Support in Server] More...
 
- Public Member Functions inherited from Annot
 exportToJSON ()
 Export the current annotation to a Json object. [Support in Server] More...
 
 getBorderColor ()
 Get annotation's border color. [Support in Server] More...
 
 getBorderInfo ()
 Get annotation's border information. [Support in Server] More...
 
 getContent ()
 Get annotation's contents. [Support in Server] More...
 
 getDictionaryEntry (key)
 Get the dictionary property of Annot by key. More...
 
 getFlags ()
 Get annotation's flag. [Support in Server] More...
 
 getModifiedDateTime ()
 Get annotation's last modified date time. [Support in Server] More...
 
 getObjectNumber ()
 Get annotation's object number. More...
 
 getPage ()
 Get annotation's page. [Support in Server] More...
 
 getRect ()
 Get annotation's rect. [Support in Server] More...
 
 getTitle ()
 Get annotation's title. [Support in Server] More...
 
 getType ()
 Get annotation's type. [Support in Server] More...
 
 getUniqueID ()
 Get annotation's unique ID. [Support in Server] More...
 
 isEmpty ()
 Check annotation is empty or not. [Support in Server] More...
 
 isMarkup ()
 Check if current annotation is a markup annotation. [Support in Server] More...
 
 setBorderColor (borderColor)
 Set annotation's border color. [Support in Server] More...
 
 setBorderInfo (borderInfo)
 Set annotation's border information. [Support in Server] More...
 
 setContent (content)
 Set contents for the currently gotten annotation. [Support in Server] More...
 
 setCustomAPStream (appearanceType, appearanceStream)
 
 setDictionaryEntry (key, value)
 Add a new entry or replace the existing entry of the annotation dictionary. Caller could use this method to store their private data to the annotation. Do not use any standard key of the annotation dictionary, such as 'Type', 'Subtype', 'Rect' defined in PDF Reference. If any standard key is used, this behaviour will be undefined. More...
 
 setFlags (flag, notTriggerEvent)
 Set annotation's flag. [Support in Server] More...
 
 setModifiedDateTime (date)
 Set annotation's last modified date time. [Support in Server] More...
 
 setRect (rect)
 Set annotation's rect. More...
 

Detailed Description

Markup annot object.

Member Function Documentation

◆ addMarkedState()

Markup::addMarkedState (   stateName)
inline

Add marked state with specific name [Support in Server]

Parameters
stateNamestring - PDF.annots.constant.MARKUP_ANNOTATION_STATE
Returns
Promise<Note> - The marked state annot instance

◆ addReply()

Markup::addReply (   content)
inline

Add a new reply to the end of reply list. [Support in Server]

Parameters
contentstring - Contents of reply annot.
Returns
Promise<Note> - event PDFViewCtrl.constants.ViewerEvents.annotationReplyAdd Note

◆ addReviewState()

Markup::addReviewState (   stateName)
inline

Add review state with specific name. [Support in Server]

Parameters
stateNamestring - markup annotation review/mark state. Please refer to MARKUP_ANNOTATION_STATE.
Returns
Promise<Note> - The review state annot instance.

◆ addRichText()

Markup::addRichText (   datas)
inline

Add new text data with rich styles to the end. Note: Now, only support Freetext annotation. if current annotation is a freetext and its intent is "FreeTextTypewriter", text aligment of input style will be set to all rich text strings of current freetext annotation.

Parameters
datasobject[] - An array of rich text data.
datas[].contentstring - Text string to be set as content for specified rich text. This should not be an empty string.
datas[].richTextStyleobject - The style data of a rich text string
datas[].richTextStyle.fontobject - A valid font object.
datas[].richTextStyle.font.namestring - the face name of the font. If it`s a standard font, the font styles and charset will not work. The standard font are 'Courier','Courier-Bold','Courier-BoldOblique','Courier-Oblique', 'Helvetica','Helvetica-Bold','Helvetica-BoldOblique','Helvetica-Oblique','Times-Roman', 'Times-Bold','Times-BoldItalic','Times-Italic','Symbol','ZapfDingbats'. While using 'Symbol' or 'ZapfDingbats, the parameter "richTextStyle.isBold" and "richTextStyle.isItalic" will not work. If it`s a custom font, you should call PDFViewer.setJRFontMap to map the available fonts.
datas[].richTextStyle.font.stylesnumber - The font styles. Please refer to Font_Styles .
datas[].richTextStyle.font.charsetnumber - The charset of the font. Please refer to Font_Charset or Font_CIDCharset .
datas[].richTextStyle.textSizenumber - Text size. It should not be negative value. 0 means text will not be shown.
datas[].richTextStyle.textAlignmentnumber - Alignment value. Please Refer to Alignment .
datas[].richTextStyle.textColornumber - Text color. Format: 0xRRGGBB.
datas[].richTextStyle.isBoldboolean - A boolean value which indicates whether to make text bold or not.
datas[].richTextStyle.isItalicboolean - A boolean value which indicates whether to italicize text or not.
datas[].richTextStyle.isUnderlineboolean - A boolean value which indicates whether to underline text or not.
datas[].richTextStyle.isStrikethroughboolean - A boolean value which indicates whether to cross text out with strike through or not.
datas[].richTextStyle.cornerMarkStylenumber - Corner mark style which can be used to make text as superscript or subscript or not as any kind of corner mark. 1 - Corner mark style: none. 2 - Corner mark style: superscript. 3 - Corner mark style: subscript.
Since
8.4.0

◆ exportToJSON()

Markup::exportToJSON ( )
inline

Export annotation to a json object. [Support in Server] Override Annot::exportToJSON.

Returns
object - A json object with caret properties:
{
...AnnotJSON,//properties from Annot::exportToJSON
opacity:{number},
creationdate:{string},//with format:"D:yyyyMMddhhmmssTZ"
IT:{string},
intent:{string},
subject:{string},
title:{string},
inreplyto:{string}
}

◆ getCreateDateTime()

Markup::getCreateDateTime ( )
inline

Get creation date time. [Support in Server]

Returns
Date - A Date object that receives the creation date time. If there is no creation date time information, new Date() would be returned.

◆ getGroupElements()

Markup::getGroupElements ( )
inline

Get the group annotations which own current annotation. [Support in Server]

Returns
Annot[] - An array of group annotations.

◆ getGroupHeader()

Markup::getGroupHeader ( )
inline

Get the header annotation (as primary annotation) of the group that current markup annotation belongs to. [Support in Server]

Returns
Markup - A markup annot which is group header.

◆ getIntent()

Markup::getIntent ( )
inline

Get intent name.
Following annotation types have predefined intent name:

  • FreeText annotation's predefined intent name: "FreeTextCallout", "FreeTextTypewriter". If no intent name is used, free text annotation would be shown as a text box.
  • Line annotation's predefined intent name: "LineArrow", "LineDimension". If no intent name is used, line annotation would be shown as a common line.
  • Polygon's predefined intent name: "PolygonCloud", "PolygonDimension". If no intent name is used, polygon annotation would be shown as a common polygon.
  • PolyLine annotation's predefined intent name: "PolyLineDimension". If no intent name is used, polyline annotation would be shown as a common polyline.
    Returns
    string- Annotaions's intent.

◆ getMarkedState()

Markup::getMarkedState (   index)
inline

Get a state annotation by index. state model is marked [Support in Server]

Parameters
indexnumber - State annotation's index.
Returns
Note - State annotation.

◆ getMarkedStateCount()

Markup::getMarkedStateCount ( )
inline

Get the count of state annotations. [Support in Server]

Usually, when state model is marked, the markup annotation only has one state annotation.

Returns
number - The length of marked state annotations.

◆ getMarkedStates()

Markup::getMarkedStates ( )
inline

Get all state annotation. state model is marked [Support in Server]

Returns
Note[] - State annotations.

◆ getOpacity()

Markup::getOpacity ( )
inline

Get opacity value.
This property has effect on markup annotation's appearance. [Support in Server]

Returns
number - The opacity value. Valid range: 0.0 to 1.0. 0.0 means full transparency and 1.0 means full opaque.

◆ getPopup()

Markup::getPopup ( )
inline

Get annotation's popup. [Support in Server]

Returns
Annot - Popup annotation.

◆ getReplies()

Markup::getReplies ( )
inline

Get all replies [Support in Server]

Returns
Note[] - An array with all reply annotations.

◆ getReply()

Markup::getReply (   index)
inline

Get a reply annot by index. [Support in Server]

Parameters
indexnumber - An integer indicating reply annotation's position.
Returns
Note - An reply annotation.

◆ getReplyCount()

Markup::getReplyCount ( )
inline

Count all replies. [Support in Server]

Returns
number - The number of all replies.

◆ getReviewState()

Markup::getReviewState (   index)
inline

Get a state annotation by index. state model is review [Support in Server]

Parameters
indexnumber - Review annotation's index.
Returns
Note - Review annotation.

◆ getReviewStateCount()

Markup::getReviewStateCount ( )
inline

Get the count of state annotations. [Support in Server]
When state model is review, the markup annotation can have several state annotations in a chain: first state annotation refers to the markup annotation, second state annotation refers to the first state annotation, etc. Just like this: markup annotation <– reviewed state1 <– reviewed state2 ...

Returns
number - Length of review state annotations.

◆ getReviewStates()

Markup::getReviewStates ( )
inline

Get all state annotation. state model is review [Support in Server]

Returns
Note[] - Review annotations.

◆ getRichText()

Markup::getRichText ( )
inline

Get the rich text data, including rich text strings and styles. Note: Now, only support Freetext annotation. if current annotation is a freetext and its intent is "FreeTextTypewriter", text aligment of input style will be set to all rich text strings of current freetext annotation.

Returns
Promise<Array<any>> - An array of rich text data.
[
{
"index": {number},
"content": {string},
"richTextStyle": {
"fontName": {string},
"textSize": {number},
"textAlignment": {number}, //common::Alignment
"textColor": {number},
"isBold": {boolean},
"isItalic": {boolean},
"isUnderline": {boolean},
"isStrikethrough": {boolean},
"cornerMarkStyle": {number}, //1: None, 2: superscript, 3: subscript
}
}
]
Since
8.4.0

◆ getSubject()

Markup::getSubject ( )
inline

Get subject string. [Support in Server]

Returns
string - A string indicating annot's subject.

◆ getTitle()

Markup::getTitle ( )
inline

Get title string. [Support in Server]

Returns
string - A string indicating annot's title.

◆ insertRichText()

Markup::insertRichText (   datas)
inline

Insert rich text string to the place which is specified by indexs.

Note: Now, only support Freetext annotation. if current annotation is a freetext and its intent is "FreeTextTypewriter", text aligment of input style will be set to all rich text strings of current freetext annotation.

Parameters
datasobject[] - An array of rich text data.
datas[].indexnumber - Index for a rich text string whose style data is to be inserted at. Valid range: from 0 to (count-1). count is returned by function getRichText. If input value is equal to rich text string count, that means to add the new rich text string to the end. In this case, this funcion equals to function AddRichText.
datas[].contentstring - Text string to be set as content for specified rich text. This should not be an empty string.
datas[].richTextStyleobject - The style data of a rich text string
datas[].richTextStyle.fontobject - A valid font object.
datas[].richTextStyle.font.namestring - the face name of the font. If it`s a standard font, the font styles and charset will not work. The standard font are 'Courier','Courier-Bold','Courier-BoldOblique','Courier-Oblique', 'Helvetica','Helvetica-Bold','Helvetica-BoldOblique','Helvetica-Oblique','Times-Roman', 'Times-Bold','Times-BoldItalic','Times-Italic','Symbol','ZapfDingbats'. While using 'Symbol' or 'ZapfDingbats, the parameter "richTextStyle.isBold" and "richTextStyle.isItalic" will not work. If it`s a custom font, you should call PDFViewer.setJRFontMap to map the available fonts.
datas[].richTextStyle.font.stylesnumber - The font styles. Please refer to Font_Styles .
datas[].richTextStyle.font.charsetnumber - The charset of the font. Please refer to Font_Charset or Font_CIDCharset .
datas[].richTextStyle.textSizenumber - Text size. It should not be negative value. 0 means text will not be shown.
datas[].richTextStyle.textAlignmentnumber - Alignment value. Please Refer to Alignment .
datas[].richTextStyle.textColornumber - Text color. Format: 0xRRGGBB.
datas[].richTextStyle.isBoldboolean - A boolean value which indicates whether to make text bold or not.
datas[].richTextStyle.isItalicboolean - A boolean value which indicates whether to italicize text or not.
datas[].richTextStyle.isUnderlineboolean - A boolean value which indicates whether to underline text or not.
datas[].richTextStyle.isStrikethroughboolean - A boolean value which indicates whether to cross text out with strike through or not.
datas[].richTextStyle.cornerMarkStylenumber - Corner mark style which can be used to make text as superscript or subscript or not as any kind of corner mark. 1 - Corner mark style: none. 2 - Corner mark style: superscript. 3 - Corner mark style: subscript.
Since
8.4.0

◆ isGrouped()

Markup::isGrouped ( )
inline

Check whether current markup annotation is in a group or not. [Support in Server]

Returns
boolean - True for in, otherwise not.

◆ isGroupHeader()

Markup::isGroupHeader ( )
inline

Check whether current markup annotation is a group header annotation. [Support in Server]

Returns
Markup[] - True for positive, otherwise negtive.

◆ removeAllStateAnnots()

Markup::removeAllStateAnnots ( )
inline

Remove all sate from this markup annotation. [Support in Server]

Returns
Promise<boolean> -

◆ removeRichText()

Markup::removeRichText (   indexes)
inline

Remove a rich text string specified by index.

Note: Now, only support Freetext annotation. if current annotation is a freetext and its intent is "FreeTextTypewriter", text aligment of input style will be set to all rich text strings of current freetext annotation.

Parameters
indexesnumber[] - An array of index. Index for a rich text string whose style data is to be inserted at. Valid range: from 0 to (count-1).
Since
8.4.0

◆ setContent()

Markup::setContent (   content)
inline

Set markup annotation's contents. [Support in Server]

Parameters
contentstring - New contents to be setted.
Returns
Promise<Annot[]> - An array of modified annotations.

◆ setCreateDateTime()

Markup::setCreateDateTime (   date)
inline

Set creation date time. [Support in Server]

Parameters
datenumber - Millisecond value
Returns
Promise<Annot[]> - Annotations modified.
event
PDFViewCtrl.constants.ViewerEvents.annotationUpdated Annot[] PDFPage

◆ setIntent()

Markup::setIntent (   intent)
inline

Set annotaions's intent.

Parameters
intentstring - Annotation's new intent.
Returns
Promise<Annot[]> - Annotations modified.

◆ setOpacity()

Markup::setOpacity (   opacity)
inline

Set opacity value. [Support in Server]

Parameters
opacitynumber - The new opacity value. Valid range: 0.0 to 1.0. 0.0 means full transparency and 1.0 means full opaque.
Returns
Promise<Annot[]|boolean> - An array of annotation objects which has been modified.
Note
The boolean type is for compatibility with Redact.setOpacity event PDFViewCtrl.constants.ViewerEvents.annotationUpdated Annot[] PDFPage
PDFViewCtrl.constants.ViewerEvents.annotationAppearanceUpdated Annot[] PDFPage

◆ setRichText()

Markup::setRichText (   datas)
inline

Set the rich text data with rich styles to the place which is specified by indexes. Note: Now, only support Freetext annotation. if current annotation is a freetext and its intent is "FreeTextTypewriter", text alignment of input style will be set to all rich text strings of current freetext annotation.

Parameters
datasobject[] - An array of rich text data.
datas[].indexnumber - Index for a rich text string whose content is to be retrieved. Valid range: from 0 to (count-1). count is returned by function getRichText.
datas[].contentstring - Text string to be set as content for specified rich text. This should not be an empty string.
datas[].richTextStyleobject - The style data of a rich text string
datas[].richTextStyle.fontobject - A valid font object.
datas[].richTextStyle.font.namestring - the face name of the font. If it`s a standard font, the font styles and charset will not work. The standard font are 'Courier','Courier-Bold','Courier-BoldOblique','Courier-Oblique', 'Helvetica','Helvetica-Bold','Helvetica-BoldOblique','Helvetica-Oblique','Times-Roman', 'Times-Bold','Times-BoldItalic','Times-Italic','Symbol','ZapfDingbats'. While using 'Symbol' or 'ZapfDingbats, the parameter "richTextStyle.isBold" and "richTextStyle.isItalic" will not work. If it`s a custom font, you should call PDFViewer.setJRFontMap to map the available fonts.
datas[].richTextStyle.font.stylesnumber - The font styles. Please refer to Font_Styles .
datas[].richTextStyle.font.charsetnumber - The charset of the font. Please refer to Font_Charset or Font_CIDCharset .
datas[].richTextStyle.textSizenumber - Text size. It should not be negative value. 0 means text will not be shown.
datas[].richTextStyle.textAlignmentnumber - Alignment value. Please Refer to Alignment .
datas[].richTextStyle.textColornumber - Text color. Format: 0xRRGGBB.
datas[].richTextStyle.isBoldboolean - A boolean value which indicates whether to make text bold or not.
datas[].richTextStyle.isItalicboolean - A boolean value which indicates whether to italicize text or not.
datas[].richTextStyle.isUnderlineboolean - A boolean value which indicates whether to underline text or not.
datas[].richTextStyle.isStrikethroughboolean - A boolean value which indicates whether to cross text out with strike through or not.
datas[].richTextStyle.cornerMarkStylenumber - Corner mark style which can be used to make text as superscript or subscript or not as any kind of corner mark. 1 - Corner mark style: none. 2 - Corner mark style: superscript. 3 - Corner mark style: subscript.
Since
8.4.0

◆ setSubject()

Markup::setSubject (   subject)
inline

Set subject string. [Support in Server]

Parameters
subjectstring - A string indicating annot's subject.
Returns
Promise<Annot[]> - event PDFViewCtrl.constants.ViewerEvents.annotationUpdated Annot[] PDFPage

◆ setTitle()

Markup::setTitle (   title)
inline

Set title string. [Support in Server]

Parameters
titlestring - A string indicating annot's title.
Returns
Promise<Annot[]> - event PDFViewCtrl.constants.ViewerEvents.annotationUpdated Annot[] PDFPage

Foxit Software Corporation Logo
@2024 Foxit Software Incorporated. All rights reserved.