FoxitPDFSDKforWeb  v9.2.1
Foxit PDF SDK for Web
Line Class Reference

Line annot object. More...

Inheritance diagram for Line:
Markup Annot

Public Member Functions

 enableCaption (enable)
 Toggle line's caption. [Support in Server] More...
 
 exportToJSON ()
 Export annotation to a json object. [Support in Server] Override Markup::exportToJSON. More...
 
 getCaptionColor ()
 Get annotation's caption color. More...
 
 getCaptionOffset ()
 Get line's caption offset. [Support in Server] More...
 
 getEndingStyle ()
 Get line head ending style. [Support in Server] More...
 
 getEndPoint ()
 Get line end point. [Support in Server] More...
 
 getLeaderLineExtend ()
 Get line's leader line extend length. [Support in Server] More...
 
 getLeaderLineLength ()
 Get line's leader line length. [Support in Server] More...
 
 getLeaderLineOffset ()
 Get line's leader line offset. [Support in Server] More...
 
 getLeaderLinePoints ()
 Get leader line points. [Support in Server] More...
 
 getMeasureRatio ()
 
 getMeasureUnit ()
 
 getStartPoint ()
 Get line start point. [Support in Server] More...
 
 getStartStyle ()
 Get line tail ending style. [Support in Server] More...
 
 getStyleFillColor ()
 Get free text's fill color. [Support in Server] More...
 
 hasCaption ()
 Check line has caption or not. [Support in Server] More...
 
 setCaptionColor (captionColor)
 Set annotation's caption color. More...
 
 setCaptionOffset (x, y)
 Set line's caption offset. [Support in Server] More...
 
 setEndingStyle (isBeginning, endingStyle)
 Set line terminal style. [Support in Server] More...
 
 setEndPoint (point)
 Set line end point. [Support in Server] More...
 
 setLeaderLineExtend (length)
 Set line's leader line extend length. [Support in Server] More...
 
 setLeaderLineLength (length)
 Set line's leader line length. [Support in Server] More...
 
 setLeaderLineOffset (offset)
 Set line's leader line offset. [Support in Server] More...
 
 setMeasureRatio ({ userSpaceValue=1, userSpaceUnit='inch', realValue=1, realUnit='inch' }={})
 
 setMeasureUnit (unit)
 
 setStartPoint (point)
 Set line start point. [Support in Server] More...
 
 setStyleFillColor (styleFillColor)
 Set annotation's fill color. [Support in Server] More...
 
- Public Member Functions inherited from Markup
 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...
 
 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

Line annot object.

Member Function Documentation

◆ enableCaption()

Line::enableCaption (   enable)
inline

Toggle line's caption. [Support in Server]

Parameters
enableboolean - True to show caption, false to hide.
Returns
Promise<void>

◆ exportToJSON()

Line::exportToJSON ( )
inline

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

Returns
object - A json object with caret properties:
{
...MarkupAnnotJSON,//JSON object from Markup::exportToJSON()
start:{string},//such as "{x},{y}"
end:{string},//such as "{x},{y}"
head:{string},//refer to Line::getStartStyle
tail:{string},//refer to Line::setEndingStyle
leaderLength:{number}, // refer to Line::getLeaderLineLength
leaderExtend:{number}, // refer to line::getLeaderLineExtend
caption:{string}, // 'yes' or 'no'
}

◆ getCaptionColor()

Line::getCaptionColor ( )
inline

Get annotation's caption color.

Returns
number - An integer indicating caption color will be returned. Format: 0xRRGGBB.
Since
9.1.0

◆ getCaptionOffset()

Line::getCaptionOffset ( )
inline

Get line's caption offset. [Support in Server]

Returns
{x:number,y:number} - The offset for caption.
{
x,//The horizontal offset for caption.
y //The vertical offset for caption.
}
Since
8.1.0
function example(annot){
annot.getCaptionOffset()
}

◆ getEndingStyle()

Line::getEndingStyle ( )
inline

Get line head ending style. [Support in Server]

Returns
number - An integer value. Please refer to Ending_Style.

◆ getEndPoint()

Line::getEndPoint ( )
inline

Get line end point. [Support in Server]

Returns
{x: number, y: number} - A JSON object indicating line end point.
{
x:{number},
y:{number}
}

◆ getLeaderLineExtend()

Line::getLeaderLineExtend ( )
inline

Get line's leader line extend length. [Support in Server]

Returns
number - Leader line's extend length.

◆ getLeaderLineLength()

Line::getLeaderLineLength ( )
inline

Get line's leader line length. [Support in Server]

Returns
number - Leader line's length.

◆ getLeaderLineOffset()

Line::getLeaderLineOffset ( )
inline

Get line's leader line offset. [Support in Server]

Returns
number - Leader line's offset.

◆ getLeaderLinePoints()

Line::getLeaderLinePoints ( )
inline

Get leader line points. [Support in Server]

Returns
{start:{x:number,y:number},end:{x:number,y:number}} - A JSON object indicating leader line points.
{
start:{
x:{number},
y:{number}
},
end:{
x:{number},
y:{number}
}
}

◆ getMeasureRatio()

Line::getMeasureRatio ( )
inline

Get the scale ratio for measuring.

Returns
string - Scale ratio.
Example:
function example(annot){
annot.getMeasureRatio()
}

◆ getMeasureUnit()

Line::getMeasureUnit ( )
inline

Get the label for displaying the units for measuring.

Returns
string - A label for displaying the units.
Example:
function example(annot){
annot.getMeasureUnit()
}

◆ getStartPoint()

Line::getStartPoint ( )
inline

Get line start point. [Support in Server]

Returns
{x: number, y: number} - A JSON object indicating line start point.
{
x:{number},
y:{number}
}

◆ getStartStyle()

Line::getStartStyle ( )
inline

Get line tail ending style. [Support in Server]

Returns
number - An integer value. Please refer to Ending_Style.

◆ getStyleFillColor()

Line::getStyleFillColor ( )
inline

Get free text's fill color. [Support in Server]

Returns
number - An integer indicating fill color.

◆ hasCaption()

Line::hasCaption ( )
inline

Check line has caption or not. [Support in Server]

Returns
boolean - True for positive, false for negative.

◆ setCaptionColor()

Line::setCaptionColor (   captionColor)
inline

Set annotation's caption color.

Parameters
captionColornumber|[string,number,number,number]|string - Specify caption 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. Range: 0.0~1.0, The ratio to HTML color format is 1:255.
  • HTML color format, such as '#ff0000', 'rgb(255,0,0)', 'rgba(255,0,0,1)'
Returns
Promise<boolean> - A boolean value indicating whether success.
Since
9.1.0

◆ setCaptionOffset()

Line::setCaptionOffset (   x,
  y 
)
inline

Set line's caption offset. [Support in Server]

Parameters
xnumber - The horizontal offset for caption.
ynumber - The vertical offset for caption.
Returns
Promise<void>
Since
8.1.0
function example(annot){
annot.setCaptionOffset(1,1)
}

◆ setEndingStyle()

Line::setEndingStyle (   isBeginning,
  endingStyle 
)
inline

Set line terminal style. [Support in Server]

Parameters
isBeginningboolean - Indecated start point or end point.
endingStylenumber - An integer value indicating ending style. Please refer to Ending_Style.
Returns
Promise<void>

◆ setEndPoint()

Line::setEndPoint (   point)
inline

Set line end point. [Support in Server]

Parameters
point{x:number,y:number} - Line end point.
Returns
Promise<void>

◆ setLeaderLineExtend()

Line::setLeaderLineExtend (   length)
inline

Set line's leader line extend length. [Support in Server]

Parameters
lengthnumber - Leader line extend length.
Returns
Promise<void>
Since
8.1.0
function example(annot){
annot.setLeaderLineExtend(1)
}

◆ setLeaderLineLength()

Line::setLeaderLineLength (   length)
inline

Set line's leader line length. [Support in Server]

Parameters
lengthnumber - An integer indicating leader line length.
Returns
Promise<void>

◆ setLeaderLineOffset()

Line::setLeaderLineOffset (   offset)
inline

Set line's leader line offset. [Support in Server]

Parameters
offsetnumber - Leader line's offset. It should be a non-negative value.
Returns
Promise<void>
Since
8.1.0
function example(annot){
annot.setLeaderLineOffset(1)
}

◆ setMeasureRatio()

Line::setMeasureRatio (   { userSpaceValue=1, userSpaceUnit='inch', realValue=1, realUnit='inch' } = {})
inline

Set the scale ratio for measuring.

Parameters
measurementRatioobject
measurementRatio.userSpaceValuenumber - Set the ratio value in user space.
measurementRatio.userSpaceUnitstring - Set the ratio unit in user space. Please refer to Annot_Unit_Type
measurementRatio.realValuestring - Set the ratio value in real space.
measurementRatio.realUnitstring - Set the ratio unit in real space. Please refer to Annot_Unit_Type
Example:
function example(annot){
const Annot_Unit_Type = PDFViewCtrl.PDF.annots.constant.Annot_Unit_Type
annot.setMeasureRatio({
userSpaceValue:1,
userSpaceUnit: Annot_Unit_Type.inch,
realValue:1,
realUnit: Annot_Unit_Type.inch,
})
}

◆ setMeasureUnit()

Line::setMeasureUnit (   unit)
inline

Set the label for displaying the units for measuring.

Parameters
unitstring - A label for displaying the units. Please refer to Annot_Unit_Type
Example:
function example(annot){
annot.setMeasureUnit(PDFViewCtrl.PDF.annots.constant.Annot_Unit_Type.inch)
}

◆ setStartPoint()

Line::setStartPoint (   point)
inline

Set line start point. [Support in Server]

Parameters
point{x:number,y:number} - Line start point.
{
x:{number},
y:{number}
}
Returns
Promise<void>

◆ setStyleFillColor()

Line::setStyleFillColor (   styleFillColor)
inline

Set annotation's fill color. [Support in Server]

Parameters
styleFillColornumber|['T']|[string,number,number,number]|string - An integer indicating fill color (alpha is not supported). Supported color format:
  • 0 or ['T'] for transparent
  • number, such as 0xff0000, 16711680
  • PDF color array, such as ['RGB',1,1,1] which means white. Range: 0.0~1.0, The ratio to HTML color format is 1:255.
  • HTML color format, such as '#ff0000', 'rgb(255,0,0)', 'rgba(255,0,0,1)'
Returns
Promise<boolean> - A boolean value indicating the success or failue.

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