PDF annot object.
More...
◆ exportToJSON()
Export the current annotation to a Json object. [Support in Server]
- Returns
- {object} - A json object of annotation's property. The key and value formats try to follow XFDF specifications
- Note
- Binary data will not be exported with this function. Use PDFDoc::exportAnnotsToJSON instead.
{
type: *,
color: {string},
flags: {string},
date:{stromg},
name: *,
rect: {string},
contents: (*|string),
width: borderWidth,
customEntries:{object}
}
◆ getBorderColor()
Annot::getBorderColor |
( |
| ) |
|
|
inline |
Get annotation's border color. [Support in Server]
- Returns
- {number} - An integer indicated border color will be returned.
◆ getBorderInfo()
Get annotation's border information. [Support in Server]
- Returns
- {borderInfo|{cloudIntensity, dashPhase, dashes, style, width}} -
{
cloudIntensity:{number},
dashPhase:{number},
dashes:Array[number],
style:{number},
width:{numner}
}
◆ getContent()
Get annotation's contents. [Support in Server]
- Returns
- {*|string} - Annotation's contents will be returned.
◆ getDictionaryEntry()
Annot::getDictionaryEntry |
( |
|
key | ) |
|
|
inline |
Get the dictionary property of Annot by key.
- Parameters
-
key | - The key of the entry, whose value element will be get. It should not be an empty string. annot.getDictionaryEntry( "*") } |
- Since
- 7.5.0
- Returns
- {Promise<string>} - A string indicates annotation's key
◆ getFlags()
Get annotation's flag. [Support in Server]
- Returns
- {Promise.<T>|*}
-
{number} - Annotation flag number.
- See also
- Annot_Flags
◆ getModifiedDateTime()
Annot::getModifiedDateTime |
( |
| ) |
|
|
inline |
Get annotation's last modified date time. [Support in Server]
- Returns
- {Date|null} - A Date object, If there is no modified date time information, null would be returned
◆ getObjectNumber()
Annot::getObjectNumber |
( |
| ) |
|
|
inline |
Get annotation's object number.
- Returns
- {number} - A number indicates annotation's object number.
- Since
- 8.1.0
◆ getPage()
Get annotation's page. [Support in Server]
- Returns
- {PDFPage} - PDF page object.
◆ getRect()
Get annotation's rect. [Support in Server]
- Returns
- {PDFRect} - A PDF rectangle.
{
top:{number},
bottom:{number}
}
◆ getTitle()
Get annotation's title. [Support in Server]
- Returns
- {string} - A string indicates annotation's title.
◆ getType()
Get annotation's type. [Support in Server]
- Returns
- {string} - A string indicates annotation's type.
- See also
- Annot_Type
◆ getUniqueID()
Get annotation's unique ID. [Support in Server]
- Returns
- {string} - A string indicates annotation's unique ID.
◆ isEmpty()
Check annotation is empty or not. [Support in Server]
- Returns
- {boolean|*} - Annotation is empty or not
◆ isMarkup()
Check if current annotation is a markup annotation. [Support in Server]
- Returns
- {bool} - true means current annotation is a markup annotation, while false means current annotation is not a markup annotation.
◆ setBorderColor()
Annot::setBorderColor |
( |
|
borderColor | ) |
|
|
inline |
Set annotation's border color. [Support in Server]
- Parameters
-
borderColor | {*} - Specify border color (alpha is not supported). Supported color format:
- number, such as 0xff0000, 16711680
- PDF color array, such as ['RGB',1,1,1] which means white.
- HTML color format, such as '#ff0000', 'rgb(255,0,0)', 'rgba(255,0,0,1)'
|
- Returns
- {Promise.<T>|*} - A boolean value indicated whether success.
◆ setBorderInfo()
Annot::setBorderInfo |
( |
|
borderInfo | ) |
|
|
inline |
Set annotation's border information. [Support in Server]
- Note
- The cloudy segments are only honored by polygon, square and circle. If the cloud style was applied to others like text markup, caret, stamp, ink and note, no effect will be drawn.
- Parameters
-
borderInfo | {object} - Border infomation. |
[borderInfo.cloudIntensity] | {Integer} - Cloud intensity, Valid value range: 0 to 2. 0 means no cloudy border effect. If the value is below 0, it will have the same effect as value 0. If the value is above 2, it will have the same effect as value 2. |
[borderInfo.dashPhase] | {number} - Dash phase. |
[borderInfo.dashes] | {Array<number>} - Dashes array. |
borderInfo.style | {number} - Border style, only Border_Style.solid, Border_Style.dashed and Border_Style.cloudy are supported. |
borderInfo.width | {number} - Border width. { cloudIntensity:{number}, dashPhase:{number}, dashes:Array[number], style:{number}, width:{number}, } |
- Returns
- {Promise.<T>}
◆ setContent()
Annot::setContent |
( |
|
content | ) |
|
|
inline |
Set contents for the currently gotten annotation. [Support in Server]
- Parameters
-
content | {string} - New contents to be setted. |
- Returns
- {Promise.<Array<Annot>|Annot>} - Annotations modified will be returned.
◆ setDictionaryEntry()
Annot::setDictionaryEntry |
( |
|
key, |
|
|
|
value |
|
) |
| |
|
inline |
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.
- Parameters
-
key | - The key of the entry, whose value element will be set. It should not be an empty string. |
value | - A wide string which will be set as PDF string object to the entry. annot.setDictionaryEntry( "**", "**") } |
- Since
- 7.5.0
- Returns
- {Promise<boolean>} - A boolean value indicates success or failure
◆ setFlags()
Annot::setFlags |
( |
|
flag, |
|
|
|
notTriggerEvent |
|
) |
| |
|
inline |
Set annotation's flag. [Support in Server]
- Parameters
-
flag | {number} - An Annot_Flags number indecate annotation's flag. |
- Returns
- {Promise.<T>|*} - A boolean value indicated success or failue.
- See also
- Annot_Flags
◆ setModifiedDateTime()
Annot::setModifiedDateTime |
( |
|
date | ) |
|
|
inline |
Set annotation's last modified date time. [Support in Server]
- Parameters
-
date | {Date|number} A Date object or an interge indecate million secounds from 1970.1.1 00:00:00. |
- Returns
- {Promise.<T>|*}