LocalHyperlink
Overview
LocalHyperlink is a class in Aspose.Pdf FOSS for Java.
Inherits from: Hyperlink.
Hyperlink to another location inside the same document — either a target {@link BaseParagraph} (set via {@link #setTarget(BaseParagraph)}) or a specific 1-based page number ({@link #setTargetPageNumber(int)}).
Properties
| Name | Type | Access | Description |
|---|---|---|---|
target | BaseParagraph | Read | @return the linked paragraph, or {@code null} if a page-number link is used instead |
targetPageNumber | int | Read | @return the 1-based target page number, or {@code 0} if a paragraph target is used instead |
Methods
| Signature | Description |
|---|---|
LocalHyperlink() | Creates an empty local hyperlink. |
LocalHyperlink(target: BaseParagraph) | Creates a local hyperlink pointing at a paragraph anchor inside the same document. |
getTarget() → BaseParagraph | @return the linked paragraph, or {@code null} if a page-number link is used instead |
setTarget(target: BaseParagraph) | Sets the paragraph anchor this link should jump to. |
getTargetPageNumber() → int | @return the 1-based target page number, or {@code 0} if a paragraph target is used instead |
setTargetPageNumber(targetPageNumber: int) | Sets the page number this link should jump to (1-based). |