Loading...
Searching...
No Matches
pdftron::PDF::Annots::Line Class Reference

`#include <Line.h>`

Inheritance diagram for pdftron::PDF::Annots::Line:

## Public Types
enum | EndingStyle { e_Square , e_Circle , e_Diamond , e_OpenArrow , e_ClosedArrow , e_Butt , e_ROpenArrow , e_RClosedArrow , e_Slash , e_None , e_Unknown }
enum | IntentType { e_LineArrow , e_LineDimension , e_null }
enum | CapPos { e_Inline , e_Top }
Public Types inherited from pdftron::PDF::Annots::Markup
enum | BorderEffect { e_None , e_Cloudy }
Public Types inherited from pdftron::PDF::Annot
enum | Type { e_Text , e_Link , e_FreeText , e_Line , e_Square , e_Circle , e_Polygon , e_Polyline , e_Highlight , e_Underline , e_Squiggly , e_StrikeOut , e_Stamp , e_Caret , e_Ink , e_Popup , e_FileAttachment , e_Sound , e_Movie , e_Widget , e_Screen , e_PrinterMark , e_TrapNet , e_Watermark , e_3D , e_Redact , e_Projection , e_RichMedia , e_Unknown }
enum | Flag { e_invisible , e_hidden , e_print , e_no_zoom , e_no_rotate , e_no_view , e_read_only , e_locked , e_toggle_no_view , e_locked_contents }
enum | ActionTriggerEvent { e_action_trigger_activate = 0 , e_action_trigger_annot_enter = 1 , e_action_trigger_annot_exit = 2 , e_action_trigger_annot_down = 3 , e_action_trigger_annot_up = 4 , e_action_trigger_annot_focus = 5 , e_action_trigger_annot_blur = 6 , e_action_trigger_annot_page_open = 7 , e_action_trigger_annot_page_close = 8 , e_action_trigger_annot_page_visible = 9 , e_action_trigger_annot_page_invisible = 10 }
enum | AnnotationState { e_normal , e_rollover , e_down }
typedef pdftron::PDF::BorderStyle | BorderStyle

## Public Member Functions
| Line (SDF::Obj d=0)
| Line (const Annot &ann)
Point | GetStartPoint () const
void | SetStartPoint (const Point &sp)
Point | GetEndPoint () const
void | SetEndPoint (const Point &ep)
EndingStyle | GetStartStyle () const
void | SetStartStyle (EndingStyle sst)
EndingStyle | GetEndStyle () const
void | SetEndStyle (EndingStyle est)
double | GetLeaderLineLength () const
void | SetLeaderLineLength (const double &length)
double | GetLeaderLineExtensionLength () const
void | SetLeaderLineExtensionLength (const double &length)
bool | GetShowCaption () const
void | SetShowCaption (bool showCaption)
IntentType | GetIntentType () const
void | SetIntentType (IntentType it)
double | GetLeaderLineOffset () const
void | SetLeaderLineOffset (double length)
CapPos | GetCaptionPosition () const
void | SetCaptionPosition (const CapPos &style)
double | GetTextHOffset () const
void | SetTextHOffset (double offset)
double | GetTextVOffset () const
void | SetTextVOffset (double offset)
Public Member Functions inherited from pdftron::PDF::Annots::Markup
| Markup (SDF::Obj d=0)
| Markup (const Annot &ann)
UString | GetTitle ()
void | SetTitle (const UString &title)
void | SetTitle (const char *title)
Popup | GetPopup () const
void | SetPopup (const Popup &ppup)
double | GetOpacity () const
void | SetOpacity (double op)
UString | GetSubject () const
void | SetSubject (const UString &contents)
Date | GetCreationDates () const
void | SetCreationDates (const Date &dt)
BorderEffect | GetBorderEffect () const
void | SetBorderEffect (BorderEffect effect=e_None)
double | GetBorderEffectIntensity () const
void | SetBorderEffectIntensity (double intensity=0)
ColorPt | GetInteriorColor () const
int | GetInteriorColorCompNum () const
void | SetInteriorColor (const ColorPt &c, int CompNum)
Rect | GetContentRect () const
void | SetContentRect (const Rect &cr)
Rect | GetPadding () const
void | SetPadding (const Rect &rd)
void | SetPadding (double x)
void | RotateAppearance (double angle)
Public Member Functions inherited from pdftron::PDF::Annot
| Annot (SDF::Obj d=0)
| Annot (const Annot &d)
Annot & | operator= (const Annot &d)
bool | operator== (const Annot &d)
bool | IsValid () const
SDF::Obj | GetSDFObj () const
Type | GetType () const
Rect | GetRect () const
Rect | GetVisibleContentBox () const
bool | IsMarkup () const
void | SetRect (const Rect &pos)
Page | GetPage () const
void | SetPage (const Page &page)
SDF::Obj | GetUniqueID () const
void | SetUniqueID (const char *id, int id_buf_sz=0)
Date | GetDate () const
void | SetDate (const Date &date)
bool | GetFlag (Flag flag) const
void | SetFlag (Flag flag, bool value)
SDF::Obj | GetTriggerAction (Annot::ActionTriggerEvent trigger)
BorderStyle | GetBorderStyle () const
void | SetBorderStyle (const BorderStyle &bs, bool oldStyleOnly=false)
SDF::Obj | GetAppearance (AnnotationState annot_state=e_normal, const char *app_state=0)
void | SetAppearance (SDF::Obj app_stream, AnnotationState annot_state=e_normal, const char *app_state=0)
void | RemoveAppearance (AnnotationState annot_state=e_normal, const char *app_state=0)
void | Flatten (class Page page)
const char * | GetActiveAppearanceState () const
void | SetActiveAppearanceState (const char *astate)
ColorPt | GetColorAsRGB () const
ColorPt | GetColorAsCMYK () const
ColorPt | GetColorAsGray () const
int | GetColorCompNum () const
void | SetColor (const ColorPt &col, int numcomp=3)
int | GetStructParent () const
void | SetStructParent (const int parkeyval)
SDF::Obj | GetOptionalContent () const
void | SetOptionalContent (SDF::Obj content)
void | SetContents (const UString &contents)
UString | GetContents () const
int | GetRotation () const
void | SetRotation (int angle)
void | RefreshAppearance ()
void | RefreshAppearance (const RefreshOptions &options)
UString | GetCustomData (const UString &key) const
void | SetCustomData (const UString &key, const UString &value)
void | DeleteCustomData (const UString &key)
void | Resize (const Rect &newrect)
ptrdiff_t | GetHandleInternal ()

## Static Public Member Functions
static Line | Create (SDF::SDFDoc &doc, const Rect &pos)
static Line | CreateAnnot (SDF::SDFDoc &doc, const Rect &pos)
Static Public Member Functions inherited from pdftron::PDF::Annot
static Annot | Create (SDF::SDFDoc &doc, Type type, const Rect &pos)
static Annot * | CreateInternal (ptrdiff_t impl)

## Detailed Description

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.

Definition at line 23 of file Line.h.

## Member Enumeration Documentation

## ◆ CapPos

enum pdftron::PDF::Annots::Line::CapPos

Enumeration type describing 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.

Enumerator
e_Inline | the caption shall be centered inside the line
e_Top | the caption shall be on top of the line

Definition at line 272 of file Line.h.

## ◆ EndingStyle

enum pdftron::PDF::Annots::Line::EndingStyle

For each line, one can choose a separate style for the start and the end of the line. The styles are defined by the "EndingStyle" enumeration.

Enumerator
e_Square | A square filled with the annotation's interior color, if any.
e_Circle | A circle filled with the annotation's interior color, if any.
e_Diamond | A diamond shape filled with the annotation's interior color, if any.
e_OpenArrow | Two short lines meeting in an acute angle to form an open arrowhead.
e_ClosedArrow | Two short lines meeting in an acute angle as in the OpenArrow style and connected by a third line to form a triangular closed arrowhead filled with the annotation's interior color, if any.
e_Butt | A short line at the endpoint perpendicular to the line itself.
e_ROpenArrow | Two short lines in the reverse direction from OpenArrow.
e_RClosedArrow | A triangular closed arrowhead in the reverse direction from ClosedArrow.
e_Slash | A short line at the endpoint approximately 30 degrees clockwise from perpendicular to the line itself.
e_None | No special line ending.
e_Unknown | Non-standard or invalid ending.

Definition at line 85 of file Line.h.

## ◆ IntentType

enum pdftron::PDF::Annots::Line::IntentType

This enum represents the intent of the Line annotation. For each line, one can specify the purpose of the line by choosing its intent
defined by the "IntentType" enum.

Enumerator
e_LineArrow | Line is an arrow.
e_LineDimension | Line is a dimension.
e_null |

Definition at line 218 of file Line.h.

## Constructor & Destructor Documentation

## ◆ Line() [1/2]

pdftron::PDF::Annots::Line::Line | ( | SDF::Obj | d = 0 | ) |

Creates a Line annotation and initializes it using given Cos/SDF object.

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

## ◆ Line() [2/2]

pdftron::PDF::Annots::Line::Line | ( | const Annot & | ann | ) |
| inline

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

Parameters

  ann | Annot object used to initialize the Line annotation.

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

Definition at line 39 of file Line.h.

## Member Function Documentation

## ◆ Create()

Line pdftron::PDF::Annots::Line::Create | ( | SDF::SDFDoc & | doc,
|  | const Rect & | pos )
| static

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 in default user space units.

Returns
  A newly created blank Line annotation.

## ◆ CreateAnnot()

Line pdftron::PDF::Annots::Line::CreateAnnot | ( | SDF::SDFDoc & | doc,
|  | const Rect & | pos )
| static

## ◆ GetCaptionPosition()

CapPos pdftron::PDF::Annots::Line::GetCaptionPosition | ( |  | ) | const

Returns the caption position of a line.

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

Note
  Caption position describes the annotation's caption positioning. Default value: Inline

See also
  CapPos

## ◆ GetEndPoint()

Point pdftron::PDF::Annots::Line::GetEndPoint | ( |  | ) | const

Returns the coordinates of the end of a line.

Returns
  A point specifying the coordinates of the end of the line.

## ◆ GetEndStyle()

EndingStyle pdftron::PDF::Annots::Line::GetEndStyle | ( |  | ) | const

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

Returns
  A enum value from the "EndingStyle".

Note
  Default value: e_None.

## ◆ GetIntentType()

IntentType pdftron::PDF::Annots::Line::GetIntentType | ( |  | ) | const

Returns the intent type of the line.

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

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.

## ◆ GetLeaderLineExtensionLength()

double pdftron::PDF::Annots::Line::GetLeaderLineExtensionLength | ( |  | ) | const

Returns the leader line extension length of a line.

Returns
  A number denoting the length of the leader line extension in default user space units.

Note
  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)

## ◆ GetLeaderLineLength()

double pdftron::PDF::Annots::Line::GetLeaderLineLength | ( |  | ) | const

Returns the leader line length of a line.

Returns
  A number denoting the length of the leader line in default user space units.

Note
  Usually if this entry is specified, the line is intended to be a dimension line (see "IT" entry of the annotation dictionary).
  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)

## ◆ GetLeaderLineOffset()

double pdftron::PDF::Annots::Line::GetLeaderLineOffset | ( |  | ) | const

Returns the leader line offset length of a line.

Returns
  A number denoting the length of the leader line offset in default user space units.

Note
  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.

## ◆ GetShowCaption()

bool pdftron::PDF::Annots::Line::GetShowCaption | ( |  | ) | const

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

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

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.

## ◆ GetStartPoint()

Point pdftron::PDF::Annots::Line::GetStartPoint | ( |  | ) | const

Returns the coordinates of the start of a line.

Returns
  A point specifying the coordinates of the start of the line.

## ◆ GetStartStyle()

EndingStyle pdftron::PDF::Annots::Line::GetStartStyle | ( |  | ) | const

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

Returns
  A enum value from the "EndingStyle".

Note
  Default value: e_None.

## ◆ GetTextHOffset()

double pdftron::PDF::Annots::Line::GetTextHOffset | ( |  | ) | const

Returns the horizontal offset of the caption.

Returns
  A number denoting the horizontal offset of the caption in default user space units.

Note
  The horizontal offset specifies the offset of the caption text from the line's 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).

## ◆ GetTextVOffset()

double pdftron::PDF::Annots::Line::GetTextVOffset | ( |  | ) | const

Returns the vertical offset of the caption.

Returns
  A number denoting the vertical offset of the caption in default user space units.

Note
  The vertical offset specifies the offset of the caption text 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).

## ◆ SetCaptionPosition()

void pdftron::PDF::Annots::Line::SetCaptionPosition | ( | const CapPos & | style | ) |

Sets the caption position of a line. (Optional, PDF 1.7)

Parameters

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

Note
  Caption position describes the annotation's caption positioning. Default value: Inline

See also
  CapPos

## ◆ SetEndPoint()

void pdftron::PDF::Annots::Line::SetEndPoint | ( | const Point & | ep | ) |

Sets the coordinates of the end of a line.

Parameters

  ep | - A point specifying the coordinates of the end of the line.

## ◆ SetEndStyle()

void pdftron::PDF::Annots::Line::SetEndStyle | ( | EndingStyle | est | ) |

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

Parameters

  est | A enum value from the "EndingStyle".

Note
  Default value: e_None.

## ◆ SetIntentType()

void pdftron::PDF::Annots::Line::SetIntentType | ( | IntentType | it | ) |

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

Parameters

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

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.

## ◆ SetLeaderLineExtensionLength()

void pdftron::PDF::Annots::Line::SetLeaderLineExtensionLength | ( | const double & | length | ) |

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

Parameters

  length | A number denoting the length of the leader line extension in default user space units.

Note
  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)

## ◆ SetLeaderLineLength()

void pdftron::PDF::Annots::Line::SetLeaderLineLength | ( | const double & | length | ) |

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

Parameters

  length | A number denoting the length of the leader line in default user space units.

Note
  Usually if this entry is specified, the line is intended to be a dimension line (see "IT" entry of the annotation dictionary).
  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)

## ◆ SetLeaderLineOffset()

void pdftron::PDF::Annots::Line::SetLeaderLineOffset | ( | double | length | ) |

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

Parameters

  length | A number denoting the length of the leader line offset in default user space units.

Note
  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.

## ◆ SetShowCaption()

void pdftron::PDF::Annots::Line::SetShowCaption | ( | bool | showCaption | ) |

Sets the option of whether to show caption.

Parameters

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

Note
  If true, the text specified by the Contents or RC entries 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.

## ◆ SetStartPoint()

void pdftron::PDF::Annots::Line::SetStartPoint | ( | const Point & | sp | ) |

Sets the coordinates of the start of a line.

Parameters

  sp | A point specifying the coordinates of the end of the line.

## ◆ SetStartStyle()

void pdftron::PDF::Annots::Line::SetStartStyle | ( | EndingStyle | sst | ) |

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

Parameters

  sst | A enum value from the "EndingStyle".

Note
  Default value: e_None.

## ◆ SetTextHOffset()

void pdftron::PDF::Annots::Line::SetTextHOffset | ( | double | offset | ) |

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

Parameters

  offset | A number denoting the horizontal offset of the caption in default user space units.

Note
  The horizontal offset specifies the offset of the caption text from the line's 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).

## ◆ SetTextVOffset()

void pdftron::PDF::Annots::Line::SetTextVOffset | ( | double | offset | ) |

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

Parameters

  offset | A number denoting the vertical offset of the caption in default user space units.

Note
  The vertical offset specifies the offset of the caption text 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).

The documentation for this class was generated from the following file:

- PDF/Annots/Line.h