public class PDFTextLink
extends java.lang.Object
PDFTextLink
represents the text hyperlink in PDF page.
The PDFTextLink
defines methods to retrieve the text hyperlinks.
It can be constructed in the following way.
Example:
PDFTextPage textPage = PDFTextPage.create(pdfPage); PDFTextLink textLink = textpage.extractLinks();
PDFTextSelection
,
PDFTextPage
,
PDFPage
Modifier and Type | Method and Description |
---|---|
int |
countLinks()
Get the count of URL formatted texts inside a page.
|
java.lang.String |
getLink(int linkIndex)
Get the linked URL associated with a specific hyperlink.
|
PDFTextSelection |
getSelection(int linkIndex)
Get a
PDFTextSelection handle from a specific hyperlink. |
void |
release()
Release all resources allocated for a
PDFTextLink . |
public int countLinks() throws PDFException
integer
value that indicates count of links. -1
means an error.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.lang.String getLink(int linkIndex) throws PDFException
linkIndex
- A zero-based index of the specific hyperlink. Range: from 0 to
(linkCount - 1).linkCount
is returned by function
countLinks()
.String
object that receives the link URL.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void release() throws PDFException
PDFTextLink
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public PDFTextSelection getSelection(int linkIndex) throws PDFException
PDFTextSelection
handle from a specific hyperlink.linkIndex
- A zero-based index of the specific hyperlink. Range: from 0 to
(linkcount - 1).linkcount
is returned by function
countLinks()
.PDFTextSelection
object to receive a new PDF text
selection if successful.PDFTextSelection.release()
which is in PDFTextSelection
module.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFTextSelection