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

`#include <Link.h>`

Inheritance diagram for pdftron::PDF::Annots::Link:

## Public Types
enum | HighlightingMode { e_none , e_invert , e_outline , e_push }
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
| Link (SDF::Obj d=0)
| Link (const Annot &ann)
void | RemoveAction ()
Action | GetAction () const
void | SetAction (const Action &action)
HighlightingMode | GetHighlightingMode () const
void | SetHighlightingMode (HighlightingMode mode)
int | GetQuadPointCount () const
QuadPoint | GetQuadPoint (int idx) const
void | SetQuadPoint (int idx, const QuadPoint &qp)
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 Link | Create (SDF::SDFDoc &doc, const Rect &pos)
static Link | CreateAnnot (SDF::SDFDoc &doc, const Rect &pos)
static Link | Create (SDF::SDFDoc &doc, const Rect &pos, const Action &action)
static Link | CreateAnnot (SDF::SDFDoc &doc, const Rect &pos, const Action &action)
static UString | GetNormalizedUrl (const UString &url)
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 link annotation represents either a hypertext link to a destination elsewhere in the document or an action to be performed.

Definition at line 19 of file Link.h.

## Member Enumeration Documentation

## ◆ HighlightingMode

enum pdftron::PDF::Annots::Link::HighlightingMode

This enum specifies the highlighting mode of the Link Annotation. The annotation's highlighting mode is the visual effect that shall be used when the mouse button is pressed or held down inside its active area, possible values as follows:

e_none - No highlighting. e_invert - Invert the contents of the annotation rectangle.
e_outline - Invert the annotation's border. e_push - Display the annotation as if it were being pushed below the surface of the page.

Enumerator
e_none |
e_invert |
e_outline |
e_push |

Definition at line 96 of file Link.h.

## Constructor & Destructor Documentation

## ◆ Link() [1/2]

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

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

Parameters

  d | The Cos/SDF object to initialze the annotation with.

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

## ◆ Link() [2/2]

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

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

Parameters

  ann | Annot object used to initialize the Link annotation.

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

Definition at line 36 of file Link.h.

## Member Function Documentation

## ◆ Create() [1/2]

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

Creates a new Link annotation in the specified document.

Parameters

  doc | A document to which the Link annotation is added.
  pos | A rectangle specifying the Link annotation's bounds in default user space units.

Returns
  A newly created blank Link annotation.

## ◆ Create() [2/2]

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

Creates a new Link annotation.

Parameters

  doc | A document to which the annotation is added.
  pos | A rectangle specifying the annotation's bounds in default user space units.
  action | Action for the link annotation.

Returns
  A new Link annotation.

## ◆ CreateAnnot() [1/2]

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

## ◆ CreateAnnot() [2/2]

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

## ◆ GetAction()

Action pdftron::PDF::Annots::Link::GetAction | ( |  | ) | const

Returns the Action of the Link Annotation.

Returns
  An Action object of the Link annotation.

Note
  The return value is an action that shall be performed when the link annotation is activated

## ◆ GetHighlightingMode()

HighlightingMode pdftron::PDF::Annots::Link::GetHighlightingMode | ( |  | ) | const

Returns the highlighting mode of this Link annotation.

Returns
  the highLighting mode as a value of the enum "HighlightingMode".

Note
  The annotation's highlighting mode is the visual effect that shall be used when the mouse button is pressed or held down inside its active area.

## ◆ GetNormalizedUrl()

UString pdftron::PDF::Annots::Link::GetNormalizedUrl | ( | const UString & | url | ) |
| static

Prepends https:// to a string if it does not contain :// or . This can be important when passing a url to other APIs that expect a URI scheme.

Parameters

  url | The string to possibly be prepended

Returns
  The string that is possibly been prepended.

## ◆ GetQuadPoint()

QuadPoint pdftron::PDF::Annots::Link::GetQuadPoint | ( | int | idx | ) | const

Returns the QuadPoint located at a certain index of the QuadPoint array of the Link annotation.

Parameters

  idx | The index of the QuadPoint, starts at zero and should be less than the return value of GetQuadPointCount().

Returns
  The QuadPoint located at a certain index of the QuadPoint array of the Link annotation.

Note
  An array of n QuadPoints specifying the coordinates of n quadrilaterals in default user space that comprise the region in which the link should be active. The coordinates specifying the four vertices of the quadrilateral are in counterclockwise order. For orientation purposes, the bottom of a quadrilateral is the line formed by p1 and p2 of the QuadPoint. QuadPoints shall be ignored if any coordinate in the array lies outside the region specified by Rect.

## ◆ GetQuadPointCount()

int pdftron::PDF::Annots::Link::GetQuadPointCount | ( |  | ) | const

Returns the number of QuadPoints in the 'QuadPoints' array of the Link annotation.

Returns
  The number of QuadPoints.

Note
  An array of n QuadPoints specifying the coordinates of n quadrilaterals in default user space that comprise the region in which the link should be active. The coordinates specifying the four vertices of the quadrilateral are in counterclockwise order. For orientation purposes, the bottom of a quadrilateral is the line formed by p1 and p2 of the QuadPoint.
  QuadPoints shall be ignored if any coordinate in the array lies outside the region specified by Rect.

## ◆ RemoveAction()

void pdftron::PDF::Annots::Link::RemoveAction | ( |  | ) |

Removes this annotation's action.

## ◆ SetAction()

void pdftron::PDF::Annots::Link::SetAction | ( | const Action & | action | ) |

Sets the Action of the Link Annotation. (Optional; PDF 1.1 )

Parameters

  action | An Action object that shall be associated with this Link annotation.

Note
  The parameter is an action that shall be performed when the link annotation is activated.

## ◆ SetHighlightingMode()

void pdftron::PDF::Annots::Link::SetHighlightingMode | ( | HighlightingMode | mode | ) |

Sets the highlighting mode for this Link annotation. (Optional; PDF 1.2 )

Parameters

  mode | the mode as a value of the enum "HighlightingMode".

Note
  The annotation's highlighting mode is the visual effect that shall be used when the mouse button is pressed or held down inside its active area.

## ◆ SetQuadPoint()

void pdftron::PDF::Annots::Link::SetQuadPoint | ( | int | idx,
|  | const QuadPoint & | qp )

Set the QuadPoint to be located at a certain index of the QuadPoint array of the Link annotation. (Optional; PDF 1.6 )

Parameters

  idx | The index of the QuadPoint, starts at zero and should be less than the return value of GetQuadPointCount().
  qp | The QuadPoint to be stored in the annotation.

Note
  An array of n QuadPoints specifying the coordinates of n quadrilaterals in default user space that comprise the region in which the link should be active. The coordinates specifying the four vertices of the quadrilateral are in counterclockwise order. For orientation purposes, the bottom of a quadrilateral is the line formed by p1 and p2 of the QuadPoint. QuadPoints shall be ignored if any coordinate in the array lies outside the region specified by Rect.

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

- PDF/Annots/Link.h