public class Hyperlink extends Object
Represents a link in a Pdf document.
[C#] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.Sections.Add(); Text text1 = new Text(sec1); sec1.Paragraphs.Add(text1); Segment segment1 = text1.Segments.Add("this is a local file link"); segment1.Hyperlink = new Hyperlink(); segment1.Hyperlink.LinkFile = "c:/images/apple.jpg"; segment1.Hyperlink.LinkType = HyperlinkType.File; Text text2 = new Text(sec1); sec1.Paragraphs.Add(text2); Segment segment2 = text2.Segments.Add("this is a web link"); segment2.Hyperlink = new Hyperlink(); segment2.Hyperlink.Url = "http://localhost/popup.htm"; segment2.Hyperlink.LinkType = HyperlinkType.Web; text1 = new Text(sec1); sec1.Paragraphs.Add(text1); segment1 = text1.Segments.Add("this is a local link"); segment1.TextInfo.IsUnderline = true; segment1.Hyperlink.LinkType = HyperlinkType.Local; segment1.Hyperlink.TargetID = "product1"; Text text3 = new Text(sec1,"product 1 info ..."); sec1.Paragraphs.Add(text3); text3.IsFirstParagraph = true; text3.ID = "product1"; pdf1.Save(...); [Visual Basic] Dim pdf1 As Pdf = New Pdf() Dim sec1 As Section = pdf1.Sections.Add() Dim text1 As Text = New Text(sec1) sec1.Paragraphs.Add(text1) Dim segment1 As Segment = text1.Segments.Add("this is a local file link") segment1.Hyperlink = New Hyperlink() segment1.Hyperlink.LinkFile = "c:/images/apple.jpg" segment1.Hyperlink.LinkType = HyperlinkType.File Dim text2 As Text = New Text(sec1) sec1.Paragraphs.Add(text2) Dim segment2 As Segment = text2.Segments.Add("this is a web link") segment2.Hyperlink = New Hyperlink() segment2.Hyperlink.Url = "http://localhost/popup.htm" segment2.Hyperlink.LinkType = HyperlinkType.Web text1 = New Text(sec1) sec1.Paragraphs.Add(text1) segment1 = text1.Segments.Add("this is a local link") segment1.TextInfo.IsUnderline = True segment1.Hyperlink.LinkType = HyperlinkType.Local segment1.Hyperlink.TargetID = "product1" Dim text3 As Text = New Text(sec1, "product 1 info ...") sec1.Paragraphs.Add(text3) text3.IsFirstParagraph = True text3.ID = "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>
Modifier and Type | Field and Description |
---|---|
com.aspose.ms.System.Collections.ArrayList |
LinkActions |
Constructor and Description |
---|
Hyperlink()
Initializes a new instance of the
Hyperlink class. |
Modifier and Type | Method and Description |
---|---|
void |
addLinkAction(LinkAction action) |
Object |
completeClone()
Clones a new
Hyperlink object. |
Object |
deepClone() |
int |
getDestinationType()
Gets or sets a
DestinationType that indicates the destination type. |
String |
getLinkFile()
Gets or sets a string that indicates the link file name.
|
int |
getLinkPageNumber()
Gets or sets an int value that indicates the page number of the link page.
|
int |
getLinkType()
Gets or sets a
HyperlinkType object that indicates the link type. |
String |
getTargetID()
Gets or sets a string that indicates the link target ID.
|
String |
getUrl()
Gets or sets a string that indicates the link url.
|
boolean |
isLinkToNewWindow()
Gets or sets a boolean value that indicates whether to open file in a new window.
|
void |
isLinkToNewWindow(boolean value) |
void |
setDestinationType(int value) |
void |
setHtml5Media(String value) |
void |
setHtml5Type(String value) |
void |
setLinkFile(String value) |
void |
setLinkPageNumber(int value) |
void |
setLinkType(int value) |
void |
setTargetID(String value) |
void |
setUrl(String value) |
public int getLinkType()
Gets or sets a HyperlinkType
object that indicates the link type.
public void setLinkType(int value)
public String getTargetID()
Gets or sets a string that indicates the link target ID.
public void setTargetID(String value)
public void setHtml5Type(String value)
public void setHtml5Media(String value)
public int getDestinationType()
Gets or sets a DestinationType
that indicates the destination type.
public void setDestinationType(int value)
public String getLinkFile()
Gets or sets a string that indicates the link file name.
public void setLinkFile(String value)
public int getLinkPageNumber()
Gets or sets an int value that indicates the page number of the link page.
public void setLinkPageNumber(int value)
public String getUrl()
Gets or sets a string that indicates the link url.
public void setUrl(String value)
public boolean isLinkToNewWindow()
Gets or sets a boolean value that indicates whether to open file in a new window.
public void isLinkToNewWindow(boolean value)
public void addLinkAction(LinkAction action)
public Object deepClone()
public Object completeClone()
Clones a new Hyperlink
object.
Hyperlink
object.Copyright © 2016 Aspose. All Rights Reserved.