# Class: LineAnnot

## PDFNet. LineAnnot

#### new LineAnnot()

  A line annotation (PDF 1.3) is used to display a single straight line on the page. When opened, it should display a pop-up window containing the text of the associated note.

### Methods

#### <static> create(doc, pos)

  Creates a new Line annotation in the specified document.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `doc` | PDFNet.SDFDoc | A document to which the annotation is added.
  `pos` | PDFNet.rect | A rectangle specifying the annotation's bounds in default user space units.

  ##### Returns:

  A promise that resolves to a newly created blank Line annotation.

  Type
    PDFNet.LineAnnot

#### <static> createFromAnnot(ann)

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

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `ann` | PDFNet.Annot | Annot object used to initialize the Line annotation.

  ##### Returns:

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

  Type
    PDFNet.LineAnnot

#### <static> createFromObj(d)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `d` | PDFNet.Obj |

  ##### Returns:

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

  Type
    PDFNet.LineAnnot

#### getCapPos()

  ##### Returns:

  A promise that resolves to an unknown type

  ##### Example

      Return value enum:
      <pre>
      PDFNet.LineAnnot.CapPos = {
      	e_Inline : 0
      	e_Top : 1
      }
      </pre>

#### getEndPoint()

  Returns the coordinates of the end of a line.

  ##### Returns:

  A promise that resolves to a point specifying the coordinates of the end of the line.

  Type
    PDFNet.point

#### getEndStyle()

  Returns the ending style that applies to the second point of the line.

  ##### Returns:

  A promise that resolves to a enum value from the "EndingStyle".

  Type
    number

  ##### Example

      Return value enum:
      <pre>
      PDFNet.LineAnnot.EndingStyle = {
      	e_Square : 0
      	e_Circle : 1
      	e_Diamond : 2
      	e_OpenArrow : 3
      	e_ClosedArrow : 4
      	e_Butt : 5
      	e_ROpenArrow : 6
      	e_RClosedArrow : 7
      	e_Slash : 8
      	e_None : 9
      	e_Unknown : 10
      }
      </pre>

#### getIntentType()

  Returns the intent type of the line.

  ##### Returns:

  A promise that resolves to an intent type value from the "IntentType" enum.

  Type
    number

  ##### Example

      Return value enum:
      <pre>
      PDFNet.LineAnnot.IntentType = {
      	e_LineArrow : 0
      	e_LineDimension : 1
      	e_null : 2
      }
      </pre>

#### getLeaderLineExtensionLength()

  Returns the leader line extension length of a line.

  ##### Returns:

  A promise that resolves to a number denoting the length of the leader line extension in default user space units.

  Type
    number

#### getLeaderLineLength()

  Returns the leader line length of a line.

  ##### Returns:

  A promise that resolves to a number denoting the length of the leader line in default user space units.

  Type
    number

#### getLeaderLineOffset()

  Returns the leader line offset length of a line.

  ##### Returns:

  A promise that resolves to a number denoting the length of the leader line offset in default user space units.

  Type
    number

#### getShowCaption()

  Returns true if caption is to be shown, otherwise false.

  ##### Returns:

  A promise that resolves to a boolean value indicating whether the caption will be shown.

  Type
    boolean

#### getStartPoint()

  Returns the coordinates of the start of a line.

  ##### Returns:

  A promise that resolves to a point specifying the coordinates of the start of the line.

  Type
    PDFNet.point

#### getStartStyle()

  Returns the ending style that applies to the first point of the line.

  ##### Returns:

  A promise that resolves to a enum value from the "EndingStyle".

  Type
    number

  ##### Example

      Return value enum:
      <pre>
      PDFNet.LineAnnot.EndingStyle = {
      	e_Square : 0
      	e_Circle : 1
      	e_Diamond : 2
      	e_OpenArrow : 3
      	e_ClosedArrow : 4
      	e_Butt : 5
      	e_ROpenArrow : 6
      	e_RClosedArrow : 7
      	e_Slash : 8
      	e_None : 9
      	e_Unknown : 10
      }
      </pre>

#### getTextHOffset()

  Returns the horizontal offset of the caption.

  ##### Returns:

  A promise that resolves to a number denoting the horizontal offset of the caption in default user space units.

  Type
    number

#### getTextVOffset()

  Returns the vertical offset of the caption.

  ##### Returns:

  A promise that resolves to a number denoting the vertical offset of the caption in default user space units.

  Type
    number

#### setCapPos(it)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `it` | number/enum |
      PDFNet.LineAnnot.CapPos = {
      	e_Inline : 0
      	e_Top : 1
      }

#### setEndPoint(ep)

  sets the coordinates of the end of a line.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `ep` | PDFNet.point | A point specifying the coordinates of the end of the line.

#### setEndStyle(es)

  sets the ending style that applies to the second point of the line. (Optional; PDF 1.4)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `es` | number/enum |
      PDFNet.LineAnnot.EndingStyle = {
      	e_Square : 0
      	e_Circle : 1
      	e_Diamond : 2
      	e_OpenArrow : 3
      	e_ClosedArrow : 4
      	e_Butt : 5
      	e_ROpenArrow : 6
      	e_RClosedArrow : 7
      	e_Slash : 8
      	e_None : 9
      	e_Unknown : 10
      }
  A enum value from the "EndingStyle".

#### setIntentType(it)

  sets the intent type of the line. (For PDF 1.6)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `it` | number/enum |
      PDFNet.LineAnnot.IntentType = {
      	e_LineArrow : 0
      	e_LineDimension : 1
      	e_null : 2
      }
  An intent type value from the "IntentType" enum.

#### setLeaderLineExtensionLength(length)

  Sets the leader line extension length of a line. (PDF 1.6)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `length` | number | A number denoting the length of the leader line extension in default user space units.

#### setLeaderLineLength(length)

  Sets the leader line length of a line. (PDF 1.6)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `length` | number | A number denoting the length of the leader line in default user space units.

#### setLeaderLineOffset(length)

  sets the leader line offset length of a line. (PDF 1.7)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `length` | number | A number denoting the length of the leader line offset in default user space units.

#### setShowCaption(showCaption)

  Sets the option of whether to show caption.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `showCaption` | boolean | A boolean value indicating whether the caption will be shown.

#### setStartPoint(sp)

  sets the coordinates of the start of a line.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `sp` | PDFNet.point | A point specifying the coordinates of the end of the line.

#### setStartStyle(ss)

  sets the ending style that applies to the first point of the line. (Optional; PDF 1.4.)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `ss` | number/enum |
      PDFNet.LineAnnot.EndingStyle = {
      	e_Square : 0
      	e_Circle : 1
      	e_Diamond : 2
      	e_OpenArrow : 3
      	e_ClosedArrow : 4
      	e_Butt : 5
      	e_ROpenArrow : 6
      	e_RClosedArrow : 7
      	e_Slash : 8
      	e_None : 9
      	e_Unknown : 10
      }
  A enum value from the "EndingStyle".

#### setTextHOffset(offset)

  sets the horizontal offset of the caption. (For PDF 1.7 )

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `offset` | number | A number denoting the horizontal offset of the caption in default user space units.

#### setTextVOffset(offset)

  sets the vertical offset of the caption. (For PDF 1.7 )

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `offset` | number | A number denoting the vertical offset of the caption in default user space units.

#### Search results