Summary: Constants | Inherited Constants | Ctors | Methods | Inherited Methods | [Expand All]
public class

# Line

extends Markup

java.lang.Object
↳ | com.pdftron.pdf.Annot
| ↳ | com.pdftron.pdf.annots.Markup
|  | ↳ | com.pdftron.pdf.annots.Line

Known Direct Subclasses PolyLine
PolyLine | Polyline annotations (PDF 1.5) display (open or closed) shapes of multiple edges on the page.

Known Indirect Subclasses Polygon
Polygon | The Polygon class.

## Class Overview

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

## Summary

Constants
int | e_Butt | The Constant e_Butt.
int | e_Circle | The Constant e_Circle.
int | e_ClosedArrow | The Constant e_ClosedArrow.
int | e_Diamond | The Constant e_Diamond.
int | e_Inline | This integer list represents the caption position of the Line annotation.
int | e_LineArrow | This integer list represents the intent of the Line annotation.
int | e_LineDimension | The Constant e_LineDimension.
int | e_None | The Constant e_None.
int | e_OpenArrow | The Constant e_OpenArrow.
int | e_RClosedArrow | The Constant e_RClosedArrow.
int | e_ROpenArrow | The Constant e_ROpenArrow.
int | e_Slash | The Constant e_Slash.
int | e_Square | For each line, one can choose a style for the start of the line and a syle for the end of line respectively.
int | e_Top | The Constant e_Top.
int | e_Unknown | The Constant e_Unknown.
int | e_null | The Constant e_null.

[Expand] Inherited Constants
From class com.pdftron.pdf.annots.Markup
int | e_Cloudy | The Constant e_Cloudy.
int | e_None | This integer list represents the Border Effect of the Markup annotation e_None - No effect e_Cloudy - The border should appear "cloudy".
From class com.pdftron.pdf.Annot
int | e_3D | The Constant e_3D.
int | e_Caret | The Constant e_Caret.
int | e_Circle | The Constant e_Circle.
int | e_FileAttachment | The Constant e_FileAttachment.
int | e_FreeText | The Constant e_FreeText.
int | e_Highlight | The Constant e_Highlight.
int | e_Ink | The Constant e_Ink.
int | e_Line | The Constant e_Line.
int | e_Link | The Constant e_Link.
int | e_Movie | The Constant e_Movie.
int | e_Polygon | The Constant e_Polygon.
int | e_Polyline | The Constant e_Polyline.
int | e_Popup | The Constant e_Popup.
int | e_PrinterMark | The Constant e_PrinterMark.
int | e_Projection | The Constant e_Projection.
int | e_Redact | The Constant e_Redact.
int | e_RichMedia | The Constant e_RichMedia.
int | e_Screen | The Constant e_Screen.
int | e_Sound | The Constant e_Sound.
int | e_Square | The Constant e_Square.
int | e_Squiggly | The Constant e_Squiggly.
int | e_Stamp | The Constant e_Stamp.
int | e_StrikeOut | The Constant e_StrikeOut.
int | e_Text | PDF supports the standard annotation types listed in the following enumeration (plug-in extensions may add new annotation types):.
int | e_TrapNet | The Constant e_TrapNet.
int | e_Underline | The Constant e_Underline.
int | e_Unknown | The Constant e_Unknown.
int | e_Watermark | The Constant e_Watermark.
int | e_Widget | The Constant e_Widget.
int | e_action_trigger_activate | Triggered when the annotation is activated.
int | e_action_trigger_annot_blur | Triggered when the annotation loses the input focus
int | e_action_trigger_annot_down | Triggered when the mouse button is pressed inside the annotation's active area
int | e_action_trigger_annot_enter | Triggered when the cursor enters the annotation's active area
int | e_action_trigger_annot_exit | Triggered when the cursor exits the annotation's active area
int | e_action_trigger_annot_focus | Triggered when the annotation receives the input focus
int | e_action_trigger_annot_page_close | Triggered when the page containing the annotation is closed
int | e_action_trigger_annot_page_invisible | Triggered when the page containing the annotation is no longer visible in the interactive PDF processor's user interface
int | e_action_trigger_annot_page_open | Triggered when the page containing the annotation is opened
int | e_action_trigger_annot_page_visible | Triggered when the page containing the annotation becomes visible
int | e_action_trigger_annot_up | Triggered when the mouse button is released inside the annotation's active area
int | e_down | The Constant e_down.
int | e_hidden | The Constant e_hidden.
int | e_invisible | Flags specifying various characteristics of the annotation.
int | e_locked | The Constant e_locked.
int | e_locked_contents | The Constant e_locked_contents.
int | e_no_rotate | The Constant e_no_rotate.
int | e_no_view | The Constant e_no_view.
int | e_no_zoom | The Constant e_no_zoom.
int | e_normal | An annotation can define as many as three separate appearances: The normal appearance is used when the annotation is not interacting with the user.
int | e_print | The Constant e_print.
int | e_read_only | The Constant e_read_only.
int | e_rollover | The Constant e_rollover.
int | e_toggle_no_view | The Constant e_toggle_no_view.

Public Constructors
| Line(Obj d) Creates an Line annotation and initialize it using given Cos/SDF object.
| Line() Creates an empty Line annotation.
| Line(Annot annot) Creates an Line annotation and initialize it using given annotation object.

Public Methods
static Line | create(Doc doc, Rect pos) Creates a new Line annotation, in the specified document.
int | getCaptionPosition() Get the caption position of a line.
Point | getEndPoint() Get the coordinates of the end of a line.
int | getEndStyle() Get the ending syle of the end of a line.
int | getIntentType() Get the intent type of the line.
double | getLeaderLineExtensionLength() Get the leader line extension length of a line.
double | getLeaderLineLength() Get the leader line length of a line.
double | getLeaderLineOffset() Get the leader line offset length of a line.
boolean | getShowCaption() Get the option of whether to show caption.
Point | getStartPoint() Get the coordinates of the start of a line.
int | getStartStyle() Get the ending syle of the start of a line.
double | getTextHOffset() Get the horizontal offset of the caption.
double | getTextVOffset() Get the vertical offset of the caption.
void | setCaptionPosition(int style) Set the caption position of a line.
void | setEndPoint(Point ep) Set the coordinates of the end of a line.
void | setEndStyle(int est) Set the ending syle of the end of a line (Optional; PDF 1.4) Note: Default value: e_None.
void | setIntentType(int style) Set the intent type of the line.
void | setLeaderLineExtensionLength(double ll) Set the leader line extension length of a line.
void | setLeaderLineLength(double ll) Set the leader line length of a line.
void | setLeaderLineOffset(double ll) Set the leader line offset length of a line.
void | setShowCaption(boolean showCaption) Set the option of whether to show caption.
void | setStartPoint(Point sp) Set the coordinates of the start of a line.
void | setStartStyle(int sst) Set the ending syle of the start of a line (Optional; PDF 1.4.) Note: Default value: e_None.
void | setTextHOffset(double offset) Set the horizontal offset of the caption.
void | setTextVOffset(double offset) Set the vertical offset of the caption.

[Expand] Inherited Methods
From class com.pdftron.pdf.annots.Markup
int | getBorderEffect() Gets the Border Effect of the Markup Annotation.
double | getBorderEffectIntensity() Gets the Border Effect Intensity of the Markup Annotation.
Rect | getContentRect() Gets the inner bounding rectangle of the Square.
Date | getCreationDates() Gets the creation date of the Markup Annotation.
ColorPt | getInteriorColor() Gets the interior color of the Square.
int | getInteriorColorCompNum() Gets the number indicating interior color space of the Square.
double | getOpacity() Gets the contant opacity value corresponding to the annotation.
Rect | getPadding() Gets the rectangle difference of the Square.
Popup | getPopup() Gets the Popup object associated with this Markup annotation.
String | getSubject() Gets subject of the Markup Annotation.
String | getTitle() Gets the title of the Markup Annotation.
void | rotateAppearance(double angle) Rotates the appearance of the Markup Annotation.
void | setBorderEffect(int effect) Sets the Border Effect of the Markup Annotation.
void | setBorderEffectIntensity(double intensity) Sets the Border Effect Intensity of the Markup Annotation.
void | setContentRect(Rect cr) Sets the inner bounding rectangle of the Square.
void | setCreationDates(Date date) Sets the creation date of the Markup Annotation.
void | setInteriorColor(ColorPt cpt, int comp_num) Sets the interior color of the Square.
void | setOpacity(double opacity) Sets the contant opacity value corresponding to the annotation.
void | setPadding(double padding) Sets the rectangle difference of the Square.
void | setPadding(Rect rd) Sets the rectangle difference of the Square.
void | setPopup(Popup popup) Sets the Popup object associated with this Markup annotation.
void | setSubject(String title) Sets subject of the Markup Annotation.
void | setTitle(String title) Sets the title of the Markup Annotation.
From class com.pdftron.pdf.Annot
int | GetStructParent() Get the struct parent of an annotation.
static Annot | __Create(long impl, Object ref)
long | __GetHandle()
Object | __GetRefHandle()
static Annot | create(Doc doc, int type, Rect pos) Creates a new annotation of a given type, in the specified document.
void | deleteCustomData(String key) Deletes custom data associated with the given key.
boolean | equals(Object d) Compares two annotations for equality.
void | flatten(Page page) Flatten/Merge the existing annotation appearances with the page content and delete this annotation from a given page.
String | getActiveAppearanceState() Get the annotation's active appearance state.
Obj | getAppearance(int annot_state, String app_state) Get the annotation's appearance for the given combination of annotation and appearance states.
Obj | getAppearance() Get the annotation's appearance for the given combination of annotation and appearance states.
Obj | getAppearance(int annot_state) Get the annotation's appearance for the given combination of annotation and appearance states.
Annot.BorderStyle | getBorderStyle() Get the border style for the annotation.
ColorPt | getColorAsCMYK() Get an annotation's color.
ColorPt | getColorAsGray() Get an annotation's color.
ColorPt | getColorAsRGB() Get an annotation's color.
int | getColorCompNum() Get the color space the annotation's color is represented in.
String | getContents() Get the annotation contents.
String | getCustomData(String key) Returns custom data associated with the given key.
Date | getDate() Gets an annotation's last modified date.
boolean | getFlag(int flag) Determine if the give flag is marked flagged
Obj | getOptionalContent() Get optional content of an annotation.
Page | getPage() Get the page the annotation is associated with.
Rect | getRect() Get annoation bound rectangle
int | getRotation() Get the rotation value of the annotation.
Obj | getSDFObj() Get the SDFObj.
Obj | getTriggerAction(int trigger) Get the Action associated with the selected Annot Trigger event.
int | getType() Get the annotation type.
Obj | getUniqueID() Get the annotiation unique ID.
Rect | getVisibleContentBox() It is possible during viewing that GetRect does not return the most accurate bounding box of what is actually rendered.
int | hashCode()
boolean | isMarkup() Checks if annoation is markup.
boolean | isValid() Checks if Annot is valid.
void | refreshAppearance() Regenerates the appearance stream for the annotation.
void | refreshAppearance(RefreshOptions opts) A version of RefreshAppearance allowing custom options to make slight tweaks in behaviour.
void | removeAppearance() Removes the annotation's default appearance.
void | removeAppearance(int annot_state, String app_state) Removes the annotation's appearance for the given combination of annotation and appearance states.
void | resize(Rect pos) Resize annotation
void | setActiveAppearanceState(String astate) Set the annotation's active appearance state.
void | setAppearance(Obj app_stream, int annot_state) Set the annotation's appearance for the given combination of annotation and appearance states.
void | setAppearance(Obj app_stream) Set the annotation's appearance for the given combination of annotation and appearance states.
void | setAppearance(Obj app_stream, int annot_state, String app_state) Set the annotation's appearance for the given combination of annotation and appearance states.
void | setBorderStyle(Annot.BorderStyle bs) Set the border style for the annotation.
void | setColor(ColorPt cpt) Set an annotation's color.
void | setColor(ColorPt cpt, int comp_num) Set an annotation's color.
void | setContents(String ct) Set annotation contents.
void | setCustomData(String key, String value) Sets the custom data associated with the specified key.
void | setDate(Date date) Sets an annotation's last modified date.
void | setDateToNow() Sets an annotation's last modified date to the current time.
void | setFlag(int flag, boolean value) Set the value of given Flag.
void | setOptionalContent(Obj oc) Set optional content of an annotation.
void | setPage(Page page) Set the reference to a page the annotation is associated with.
void | setRect(Rect pos) Set the size and location of an annotation on its page.
void | setRotation(int rot) Set the rotation value of the annotation.
void | setStructParent(int keyval) Set the struct parent of an annotation.
void | setUniqueID(String icon_name) Set the unique identifier for this annotation.
From class java.lang.Object
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Constants

#### public static final int e_Butt

The Constant e_Butt.

Constant Value: 5 (0x00000005)

#### public static final int e_Circle

The Constant e_Circle.

Constant Value: 1 (0x00000001)

#### public static final int e_ClosedArrow

The Constant e_ClosedArrow.

Constant Value: 4 (0x00000004)

#### public static final int e_Diamond

The Constant e_Diamond.

Constant Value: 2 (0x00000002)

#### public static final int e_Inline

This integer list represents the caption position of the Line annotation. For each line, one can specify the purpose of the line by choosing a intent type defined by the "IntentType" enum. e_LineArrow - The line is an arrow e_LineDimension - This line is intented to function as a dimension line.

Constant Value: 0 (0x00000000)

#### public static final int e_LineArrow

This integer list represents the intent of the Line annotation. * For each line, one can specify the purpose of the line by choosing a intent type defined by the "IntentType" enum. e_LineArrow - The line is an arrow e_LineDimension - This line is intented to function as a dimension line.

Constant Value: 0 (0x00000000)

#### public static final int e_LineDimension

The Constant e_LineDimension.

Constant Value: 1 (0x00000001)

#### public static final int e_None

The Constant e_None.

Constant Value: 9 (0x00000009)

#### public static final int e_OpenArrow

The Constant e_OpenArrow.

Constant Value: 3 (0x00000003)

#### public static final int e_RClosedArrow

The Constant e_RClosedArrow.

Constant Value: 7 (0x00000007)

#### public static final int e_ROpenArrow

The Constant e_ROpenArrow.

Constant Value: 6 (0x00000006)

#### public static final int e_Slash

The Constant e_Slash.

Constant Value: 8 (0x00000008)

#### public static final int e_Square

For each line, one can choose a style for the start of the line and a syle for the end of line respectively. The styles are defined by the the following integer list.

Constant Value: 0 (0x00000000)

#### public static final int e_Top

The Constant e_Top.

Constant Value: 1 (0x00000001)

#### public static final int e_Unknown

The Constant e_Unknown.

Constant Value: 10 (0x0000000a)

#### public static final int e_null

The Constant e_null.

Constant Value: 2 (0x00000002)

## Public Constructors

#### public Line (Obj d)

Creates an Line annotation and initialize it using given Cos/SDF object.

Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.

##### Parameters

d | the input Cos/SDF object

#### public Line ()

Creates an empty Line annotation.

#### public Line (Annot annot)

Creates an Line annotation and initialize it using given annotation object.

Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.

##### Parameters

annot | the input annotation object

##### Throws

PDFNetException |

## Public Methods

#### public static Line create (Doc doc, Rect pos)

Creates a new Line annotation, in the specified document.

##### Parameters

doc | A document to which the annotation is added.
pos | A rectangle specifying the annotation's bounds, specified in user space coordinates.

##### Returns

- A newly created blank Line annotation.

##### Throws

PDFNetException |

#### public int getCaptionPosition ()

Get the caption position of a line.

Note: Caption position describs the annotation's caption positioning. Valid values are e_Inline, meaning the caption shall be centered inside the line, and e_Top, meaning the caption shall be on top of the line. Default value: Inline

##### Returns

- A cap position value from the "CapPos" enum.

##### Throws

PDFNetException |

#### public Point getEndPoint ()

Get the coordinates of the end of a line.

##### Returns

- A Point struct, whose x entry specifies the x coordinate of the end of the line and the y entry specifies the y coordinate of the end of the line.

##### Throws

PDFNetException |

#### public int getEndStyle ()

Get the ending syle of the end of a line.

Note: Default value: e_None.

##### Returns

- A enum value from the "EndingStyle" enum, whose value corrsponding to the ending style of the start point.

##### Throws

PDFNetException |

#### public int getIntentType ()

Get the intent type of the line.

Note: Intent type describes the intent of the line annotation. Valid values shall be "e_LineArrow", which means that the annotation is intended to function as an arrow, and "e_LineDimension", which means that the annotation is intended to function as a dimension line.

##### Returns

- An intent type value from the "IntentType" enum.

##### Throws

PDFNetException |

#### public double getLeaderLineExtensionLength ()

Get the leader line extension length of a line.

Note: Usually if this entry is specified, the line is intended to be a dimension line(see "IT" entry).

The leader line extension length is a non-negative number that shall represents the length of leader line extensions that extend from the line proper 180 degrees from the leader lines. Default value: 0 (no leader line extensions)

##### Returns

- A number denoting the length of the leader line extension in px.

##### Throws

PDFNetException |

#### public double getLeaderLineLength ()

Get the leader line length of a line.

Note: usually if this entry is specified, the line is intended to be a dimension line(see "IT" entry).

Leader length is length of leader lines in default user space that extend from each endpoint of the line perpendicular to the line itself. A positive value shall mean that the leader lines appear in the direction that is clockwise when traversing the line from its starting point to its ending point (as specified by L); a negative value shall indicate the opposite direction. Default value: 0 (no leader lines)

##### Returns

- A number denoting the length of the leader line in px.

##### Throws

PDFNetException |

#### public double getLeaderLineOffset ()

Get the leader line offset length of a line.

Note: usually if this entry is specified, the line is intended to be a dimension line(see "IT" entry).

Leader line offset number is a non-negative number that shall represent the length of the leader line offset, which is the amount of empty space between the endpoints of the annotation and the beginning of the leader lines.

##### Returns

- A number denoting the length of the leader line offset in px.

##### Throws

PDFNetException |

#### public boolean getShowCaption ()

Get the option of whether to show caption.

Note: If true, the text specified by the Contents or RCentries shall be replicated as a caption in the appearance of the line. The text shall be rendered in a manner appropriate to the content, taking into account factors such as writing direction. Default value: false.

##### Returns

- A boolean value indicating whether the caption will be shown.

##### Throws

PDFNetException |

#### public Point getStartPoint ()

Get the coordinates of the start of a line.

##### Returns

- A Point struct, whose x entry specifies the x coordinate of the start of the line and the y entry specifies the y coordinate of the start of the line.

##### Throws

PDFNetException |

#### public int getStartStyle ()

Get the ending syle of the start of a line.

Note: Default value: e_None.

##### Returns

- A enum value from the "EndingStyle" enum, whose value corrsponding to the ending style of the start point.

##### Throws

PDFNetException |

#### public double getTextHOffset ()

Get the horizontal offset of the caption.

Note: The horizontal offset specifies the offset of the caption text from its normal position. Specifially the horizontal offset along the annotation line from its midpoint, with a positive value indicating offset to the right and a negative value indicating offset to the left. Default value: 0 (no offset from normal horizontal positioning)

##### Returns

- A number denoting the horizontal offset of caption in px.

##### Throws

PDFNetException |

#### public double getTextVOffset ()

Get the vertical offset of the caption.

Note: The vertical offset specifies the offset of the caption text from its normal position. Specifially the vertical offset perpendicular to the annotation line, with a positive value indicating a shift up and a negative value indicating a shift down. Default value: 0(no offset from normal vertical positioning).

##### Returns

- A number denoting the vertical offset of caption in px.

##### Throws

PDFNetException |

#### public void setCaptionPosition (int style)

Set the caption position of a line. (PDF 1.7)

Note: Caption position describs the annotation's caption positioning. Valid values are e_Inline, meaning the caption shall be centered inside the line, and e_Top, meaning the caption shall be on top of the line. Default value: Inline.

##### Parameters

style | A cap position value from the "CapPos" enum.

##### Throws

PDFNetException |

#### public void setEndPoint (Point ep)

Set the coordinates of the end of a line.

##### Parameters

ep | - A Point struct whose x entry is going to be set as the x coordinate of the end point of the line, whose y entry is going to be set as the y coordinate of the end point of the line.

##### Throws

PDFNetException |

#### public void setEndStyle (int est)

Set the ending syle of the end of a line (Optional; PDF 1.4)

Note: Default value: e_None.

##### Parameters

est | A enum value from the "EndingStyle" enum, whose value corrsponding to the ending style of the start point.

##### Throws

PDFNetException |

#### public void setIntentType (int style)

Set the intent type of the line. (For PDF 1.

Note: Intent type describes the intent of the line annotation. Valid values shall be "e_LineArrow", which means that the annotation is intended to function as an arrow, and "e_LineDimension", which means that the annotation is intended to function as a dimension line.6)

##### Parameters

style | An intent type value from the "IntentType" enum.

##### Throws

PDFNetException |

#### public void setLeaderLineExtensionLength (double ll)

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

Note: Usually if this entry is specified, the line is intended to be a dimension line(see "IT" entry).

The leader line extension length is a non-negative number that shall represents the length of leader line extensions that extend from the line proper 180 degrees from the leader lines. Default value: 0 (no leader line extensions)

##### Parameters

ll | the new leader line extension length

##### Throws

PDFNetException |

#### public void setLeaderLineLength (double ll)

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

Note: Usually if this entry is specified, the line is intended to be a dimension line(see "IT" entry).

Leader length is length of leader lines in default user space that extend from each endpoint of the line perpendicular to the line itself. A positive value shall mean that the leader lines appear in the direction that is clockwise when traversing the line from its starting point to its ending point (as specified by L); a negative value shall indicate the opposite direction. Default value: 0 (no leader lines)

##### Parameters

ll | the new leader line length

##### Throws

PDFNetException |

#### public void setLeaderLineOffset (double ll)

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

Note: Usually if this entry is specified, the line is intended to be a dimension line(see "IT" entry).

Leader line offset number is a non-negative number that shall represent the length of the leader line offset, which is the amount of empty space between the endpoints of the annotation and the beginning of the leader lines.

##### Parameters

ll | A number denoting the length of the leader line offset in px.

##### Throws

PDFNetException |

#### public void setShowCaption (boolean showCaption)

Set the option of whether to show caption.

Note: If true, the text specified by the Contents or RCentries shall be replicated as a caption in the appearance of the line. The text shall be rendered in a manner appropriate to the content, taking into account factors such as writing direction. Default value: false.

##### Parameters

showCaption | A boolean value indicating whether the caption will be shown.

##### Throws

PDFNetException |

#### public void setStartPoint (Point sp)

Set the coordinates of the start of a line.

##### Parameters

sp | A Point struct whose x entry is going to be set as the x coordinate of the start point of the line, whose y entry is going to be set as the y coordinate of the start point of the line.

##### Throws

PDFNetException |

#### public void setStartStyle (int sst)

Set the ending syle of the start of a line (Optional; PDF 1.4.)

Note: Default value: e_None.

##### Parameters

sst | A enum value from the "EndingStyle" enum, whose value corrsponding to the ending style of the start point.

##### Throws

PDFNetException |

#### public void setTextHOffset (double offset)

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

Note: The horizontal offset specifies the offset of the caption text from its normal position. Specifially the horizontal offset along the annotation line from its midpoint, with a positive value indicating offset to the right and a negative value indicating offset to the left. Default value: 0 (no offset from normal horizontal positioning)

##### Parameters

offset | A umber denoting the horizontal offset of caption in px.

##### Throws

PDFNetException |

#### public void setTextVOffset (double offset)

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

Note: The vertical offset specifies the offset of the caption text from its normal position. Specifially the vertical offset perpendicular to the annotation line, with a positive value indicating a shift up and a negative value indicating a shift down. Default value: 0(no offset from normal vertical positioning).

##### Parameters

offset | A number denoting the vertical offset of caption in px.

##### Throws

PDFNetException |