pdftron::PDF::Annots::Line Class Reference

A line annotation (PDF 1.3) is used to display a single straight line on the page. More...

#include <Line.h>

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

Inheritance graph
[legend]
Collaboration diagram for pdftron::PDF::Annots::Line:

Collaboration graph
[legend]

List of all members.

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
}
 For each line, one can choose a separate style for the start and the end of the line. More...
enum  IntentType { e_LineArrow, e_LineDimension, e_null }
 This enum represents the intent of the Line annotation. More...
enum  CapPos { e_Inline, e_Top }
 Enumeration type describing the annotation’s caption positioning. More...

Public Member Functions

 Line (SDF::Obj d=0)
 Creates a Line annotation and initializes it using given Cos/SDF object.
 Line (const Annot &ann)
 Creates a Line annotation and initializes it using given annotation object.
Point GetStartPoint () const
 Returns the coordinates of the start of a line.
void SetStartPoint (const Point &sp)
 Sets the coordinates of the start of a line.
Point GetEndPoint () const
 Returns the coordinates of the end of a line.
void SetEndPoint (const Point &ep)
 Sets the coordinates of the end of a line.
EndingStyle GetStartStyle () const
 Returns the ending style that applies to the first point of the line.
void SetStartStyle (EndingStyle sst)
 Sets the ending style that applies to the first point of the line.
EndingStyle GetEndStyle () const
 Returns the ending style that applies to the second point of the line.
void SetEndStyle (EndingStyle est)
 Sets the ending style that applies to the second point of the line.
double GetLeaderLineLength () const
 Returns the leader line length of a line.
void SetLeaderLineLength (const double &ll)
 Sets the leader line length of a line.
double GetLeaderLineExtensionLength () const
 Returns the leader line extension length of a line.
void SetLeaderLineExtensionLength (const double &ll)
 Sets the leader line extension length of a line.
bool GetShowCaption () const
 Returns true if caption is to be shown, otherwise false.
void SetShowCaption (bool showCaption)
 Sets the option of whether to show caption.
IntentType GetIntentType () const
 Returns the intent type of the line.
void SetIntentType (IntentType style)
 Sets the intent type of the line.
double GetLeaderLineOffset () const
 Returns the leader line offset length of a line.
void SetLeaderLineOffset (double ll)
 Sets the leader line offset length of a line.
CapPos GetCaptionPosition () const
 Returns the caption position of a line.
void SetCaptionPosition (const CapPos &style)
 Sets the caption position of a line.
double GetTextHOffset () const
 Returns the horizontal offset of the caption.
void SetTextHOffset (double offset)
 Sets the horizontal offset of the caption.
double GetTextVOffset () const
 Returns the vertical offset of the caption.
void SetTextVOffset (double offset)
 Sets the vertical offset of the caption.

Static Public Member Functions

static Line Create (SDF::SDFDoc &doc, const Rect &pos)
 Creates a new Line annotation in the specified document.


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.


Member Enumeration Documentation

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.

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 

Reimplemented in pdftron::PDF::Annots::PolyLine.

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


Constructor & Destructor Documentation

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.

pdftron::PDF::Annots::Line::Line ( const Annot ann  )  [inline]

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

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


Member Function Documentation

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

Reimplemented in pdftron::PDF::Annots::PolyLine, and pdftron::PDF::Annots::Polygon.

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.

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.

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.

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.

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.

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.

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.

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.

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)

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

Sets the leader line length of a line.

(PDF 1.6)

Parameters:
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)

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)

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

Sets the leader line extension length of a line.

(PDF 1.6)

Parameters:
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)

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.

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.

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.

void pdftron::PDF::Annots::Line::SetIntentType ( IntentType  style  ) 

Sets the intent type of the line.

(For PDF 1.6)

Parameters:
style 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.

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.

void pdftron::PDF::Annots::Line::SetLeaderLineOffset ( double  ll  ) 

Sets the leader line offset length of a line.

(PDF 1.7)

Parameters:
ll 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.

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

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

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

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

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

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


© 2002-2010 PDFTron Systems Inc.