public class LinkAnnotation extends Annotation
| Constructor and Description |
|---|
LinkAnnotation(Page page,
Rect initialRect)
Create a new LinkAnnotation at the end of a page's annotation array.
|
LinkAnnotation(Page page,
Rect initialRect,
int addAfter)
Create a new LinkAnnotation at a specific index in the page's annotation array.
|
| Modifier and Type | Method and Description |
|---|---|
LinkAnnotation |
copyTo(Page destination)
Copy a LinkAnnotation to the specified page.
|
LinkAnnotation |
copyTo(Page destination,
Point centerPoint)
Copy a LinkAnnotation to the specified page and center the annotation on the specified point.
|
void |
delete() |
Form |
generateAppearance()
Generate a new appearance stream with the current annotation properties.
|
Action |
getAction()
The Action object for this link.
|
double |
getAnnotationFeatureLevel()
The minimum PDF version necessary to support the features used in this annotation.
|
java.lang.String |
getBorderStyle() |
java.util.List<java.lang.Double> |
getBorderStyleDashPattern() |
double |
getBorderStyleWidth() |
ViewDestination |
getDestination()
The Destination for this link.
|
HighlightStyle |
getHighlight()
The Highlighstyle for this link.
|
void |
setAction(Action newaction)
The Action object for this link.
|
void |
setAnnotationFeatureLevel(double featureLevel)
Removes features not supported in the supplied version number.
|
void |
setBorderStyle(java.lang.String style) |
void |
setBorderStyleDashPattern(java.util.List<java.lang.Double> dashPattern) |
void |
setBorderStyleWidth(double width) |
void |
setDestination(ViewDestination newdest)
The Destination for this link.
|
void |
setHighlight(HighlightStyle style)
The Highlighstyle for this link.
|
equals, getColor, getContents, getFlags, getInteriorColor, getNormalAppearance, getOpacity, getOptionalContentMembershipDict, getPDFDict, getRect, getSubtype, getTitle, hasRichTextData, isCurrentlyVisible, setColor, setContents, setFlags, setInteriorColor, setNormalAppearance, setOpacity, setOptionalContentMembershipDict, setRect, setTitle, toStringpublic LinkAnnotation(Page page, Rect initialRect)
page - The page to which the LinkAnnotation is added.initialRect - A rectangle specifying the annotation's bounds, specified in user space coordinates.public LinkAnnotation(Page page, Rect initialRect, int addAfter)
page - The page to which the annotation is added.initialRect - A rectangle specifying the annotation's bounds, specified in user space coordinates.addAfter - Where to add the annotation in the page's annotation array. To add the annotation to the end of the array, pass a value of -2 or use the alternate version of this constructor that does not take an index (this is generally what you should do unless you have a need to place the annotation at a special location in the array). Passing a value of -1 adds the annotation to the beginning of the array. Passing other negative values produces undefined results.public void delete()
delete in class Annotationpublic Action getAction()
Note that setting the Action will wipe out the Link's Destination member a link annotation cannot have both members.
public void setAction(Action newaction)
Note that setting the Action will wipe out the Link's Destination member a link annotation cannot have both members.
public ViewDestination getDestination()
Note that setting the Destination will wipe out the Link's Action member a link annotation cannot have both members.
public void setDestination(ViewDestination newdest)
Note that setting the Destination will wipe out the Link's Action member a link annotation cannot have both members.
public HighlightStyle getHighlight()
public void setHighlight(HighlightStyle style)
public Form generateAppearance()
The resulting Form can then be used to set the annotation's appearance, such as by calling SetNormalAppearance.
generateAppearance in class Annotationpublic double getAnnotationFeatureLevel()
getAnnotationFeatureLevel in class Annotationpublic void setAnnotationFeatureLevel(double featureLevel)
setAnnotationFeatureLevel in class Annotationpublic LinkAnnotation copyTo(Page destination)
This creates a copy of the original LinkAnnotation and puts the copy in the destination page's annotation dictionary. Structural content information associated with the source annotation will not be present in the copy. An exception will be thrown if the annotation cannot be copied to the specified page.
Note: If copying LinkAnnotations between pages in different documents, the source annotation may have a ViewDestination that's invalid in the destiantion document or an Action referring to a ViewDestination that's invalid in the destination document. In these cases, an exception will be thrown.
destination - the page to copy the annotation to. The page may be in the same document as the source annotation or in a different document.public LinkAnnotation copyTo(Page destination, Point centerPoint)
This creates a copy of the original LinkAnnotation and puts the copy in the destination page's annotation dictionary. Structural content information associated with the source annotation will not be present in the copy. An exception will be thrown if the annotation cannot be copied to the specified page.
Note: If copying LinkAnnotations between pages in different documents, the source annotation may have a ViewDestination that's invalid in the destiantion document or an Action referring to a ViewDestination that's invalid in the destination document. In these cases, an exception will be thrown.
destination - the page to copy the annotation to. The page may be in the same document as the source annotation or in a different document.centerPoint - the point to center the annotation on.public double getBorderStyleWidth()
public void setBorderStyleWidth(double width)
public java.lang.String getBorderStyle()
public void setBorderStyle(java.lang.String style)
public java.util.List<java.lang.Double> getBorderStyleDashPattern()
public void setBorderStyleDashPattern(java.util.List<java.lang.Double> dashPattern)