PTLink
@interface PTLink : PTAnnot
A link annotation represents either a hypertext link to a destination elsewhere in the document or an action to be performed.
-
Creates a Link 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.Parameters
d
The Cos/SDF object to initialze the annotation with.
-
Undocumented
Declaration
Objective-C
- (instancetype)init;
Swift
init!()
-
Creates a new Link annotation in the specified document.
Declaration
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.
Return Value
A newly created blank Link annotation.
-
Creates a new Link annotation.
Declaration
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.
Return Value
A new Link annotation.
-
Removes this annotation’s action.
Declaration
Objective-C
- (void)RemoveAction;
Swift
func removeAction()
-
Sets the Action of the Link Annotation. (Optional; PDF 1.1 )
Note
The parameter is an action that shall be performed when the link annotation is activated.Declaration
Objective-C
- (void)SetAction:(PTAction *)action;
Swift
func setAction(_ action: PTAction!)
Parameters
action
An Action object that shall be associated with this Link annotation.
-
Returns the highlighting mode of this Link annotation.
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.Declaration
Objective-C
- (PTLinkHighlightingMode)GetHighlightingMode;
Swift
func getHighlightingMode() -> PTLinkHighlightingMode
Return Value
the highLighting mode as a value of the enum “HighlightingMode”.
-
Sets the highlighting mode for this Link annotation. (Optional; PDF 1.2 )
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.Declaration
Objective-C
- (void)SetHighlightingMode:(PTLinkHighlightingMode)mode;
Swift
func setHighlightingMode(_ mode: PTLinkHighlightingMode)
Parameters
mode
the mode as a value of the enum “HighlightingMode”.
-
Returns the number of QuadPoints in the ‘QuadPoints’ 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.Declaration
Objective-C
- (int)GetQuadPointCount;
Swift
func getQuadPointCount() -> Int32
Return Value
The number of QuadPoints.
-
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.Declaration
Objective-C
- (PTQuadPoint *)GetQuadPoint:(int)idx;
Swift
func getQuadPoint(_ idx: Int32) -> PTQuadPoint!
Parameters
idx
The index of the QuadPoint, starts at zero and should be less than the return value of GetQuadPointCount().
Return Value
The QuadPoint located at a certain index of the QuadPoint array of the Link annotation.
-
Set the QuadPoint to be located at a certain index of the QuadPoint array of the Link annotation. (Optional; PDF 1.6 )
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.Declaration
Objective-C
- (void)SetQuadPoint:(int)idx qp:(PTQuadPoint *)qp;
Swift
func setQuadPoint(_ idx: Int32, qp: PTQuadPoint!)
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.
-
Prepends http:// 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.
Declaration
Objective-C
+ (NSString *)GetNormalizedUrl:(NSString *)url;
Swift
class func getNormalizedUrl(_ url: String!) -> String!
Parameters
url
The string to possibly be prepended
Return Value
The string that is possibly been prepended.