aspose.pdf
Class Hyperlink

java.lang.Object
  extended by aspose.pdf.Hyperlink

public class Hyperlink
extends java.lang.Object

Represents a link in a Pdf document.

Typical usages are the following:

[Java] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.getSections().add(); Text text1 = new Text(sec1); sec1.getParagraphs().add(text1); Segment segment1 = text1.getSegments().add("this is a local file link"); segment1.setHyperlink(new Hyperlink()); segment1.getHyperlink().setLinkFile("c:/images/apple.jpg"); segment1.getHyperlink().setLinkType(HyperlinkType.File); Text text2 = new Text(sec1); sec1.getParagraphs().add(text2); Segment segment2 = text2.getSegments().add("this is a web link"); segment2.setHyperlink(new Hyperlink()); segment2.getHyperlink().setUrl("http://localhost/popup.htm"); segment2.getHyperlink().setLinkType(HyperlinkType.Web); text1 = new Text(sec1); sec1.getParagraphs().add(text1); segment1 = text1.getSegments().add("this is a local link"); segment1.getTextInfo().setIsUnderline(true); segment1.getHyperlink().setLinkType(HyperlinkType.Local); segment1.getHyperlink().setTargetID("product1"); Text text3 = new Text(sec1,"product 1 info ..."); sec1.getParagraphs().add(text3); text3.setIsFirstParagraph(true); text3.setID("product1"); pdf1.Save(...); [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <Section> <Text> <Segment LinkFile="c:/Images/apple.jpg" LinkType="File"> this is a local file link </Segment> </Text> <Text> <Segment Url="http://localhost/popup.htm" LinkType="Web"> this is a web link </Segment> </Text> <Text> <Segment TargetID="product1" LinkType="Local" IsUnderline="true"> this is a local link </Segment> </Text> <Text IsFirstParagraph="true" ID="product1"> <Segment>product 1 info ...</Segment> </Text> </Section> </Pdf>


Constructor Summary
Hyperlink()
          Constructor - initializes a new instance of the Hyperlink class.
 
Method Summary
 void addLinkAction(LinkAction action)
          Add a LinkAction item to link actions.
 java.lang.Object clone()
          Clones a new Hyperlink object.
 java.lang.Object completeClone()
          Clones a new Hyperlink object.
 DestinationType getDestinationType()
          Gets a DestinationType object that indicates the destination type.
 java.util.ArrayList getLinkActions()
          Gets link action list.
 java.lang.String getLinkFile()
          Gets a String that indicates the link file name.
 int getLinkPageNumber()
          Gets an int value that indicates the page number of the link page.
 HyperlinkType getLinkType()
          Gets a HyperlinkType object that indicates the link type.
 java.lang.String getTargetID()
          Gets a String that indicates the link target ID.
 java.lang.String getUrl()
          Gets a String that indicates the link url.
 void setDestinationType(DestinationType value)
          Sets a DestinationType object that indicates the destination type.
 void setLinkFile(java.lang.String value)
          Sets a String that indicates the link file name.
 void setLinkPageNumber(int value)
          Sets an int value that indicates the page number of the link page.
 void setLinkType(HyperlinkType value)
          Sets a HyperlinkType object that indicates the link type.
 void setTargetID(java.lang.String value)
          Sets a String that indicates the link target ID.
 void setUrl(java.lang.String value)
          Sets a String that indicates the link url.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hyperlink

public Hyperlink()
Constructor - initializes a new instance of the Hyperlink class.

Method Detail

getLinkType

public HyperlinkType getLinkType()
Gets a HyperlinkType object that indicates the link type.

Returns:
A HyperlinkType object.

setLinkType

public void setLinkType(HyperlinkType value)
Sets a HyperlinkType object that indicates the link type.

Parameters:
value - A HyperlinkType object.

getTargetID

public java.lang.String getTargetID()
Gets a String that indicates the link target ID.

Returns:
Link target ID.

setTargetID

public void setTargetID(java.lang.String value)
Sets a String that indicates the link target ID.


getDestinationType

public DestinationType getDestinationType()
Gets a DestinationType object that indicates the destination type.

Returns:
A DestinationType object.

setDestinationType

public void setDestinationType(DestinationType value)
Sets a DestinationType object that indicates the destination type.

Parameters:
value - A DestinationType object.

getLinkFile

public java.lang.String getLinkFile()
Gets a String that indicates the link file name.

Returns:
Link file name.

setLinkFile

public void setLinkFile(java.lang.String value)
Sets a String that indicates the link file name.

Parameters:
value - Link file name.

getLinkPageNumber

public int getLinkPageNumber()
Gets an int value that indicates the page number of the link page.

Returns:
Page number of the link page.

setLinkPageNumber

public void setLinkPageNumber(int value)
Sets an int value that indicates the page number of the link page.

Parameters:
value - page number of the link page.

getUrl

public java.lang.String getUrl()
Gets a String that indicates the link url.

Returns:
Link url.

setUrl

public void setUrl(java.lang.String value)
Sets a String that indicates the link url.

Parameters:
value - Link url.

getLinkActions

public java.util.ArrayList getLinkActions()
Gets link action list.

Returns:
Link action list.

addLinkAction

public void addLinkAction(LinkAction action)
Add a LinkAction item to link actions.

Parameters:
action - A LinkAction object.

clone

public java.lang.Object clone()
Clones a new Hyperlink object.

Overrides:
clone in class java.lang.Object
Returns:
The new created Hyperlink object.

completeClone

public java.lang.Object completeClone()
Clones a new Hyperlink object.

Returns:
The new created Hyperlink object.