Class LinkAnnotation
-
Constructor Summary
ConstructorsConstructorDescriptionLinkAnnotation(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. -
Method Summary
Modifier and TypeMethodDescriptionCopy a LinkAnnotation to the specified page.Copy a LinkAnnotation to the specified page and center the annotation on the specified point.voiddelete()Generate a new appearance stream with the current annotation properties.The Action object for this link.doubleThe minimum PDF version necessary to support the features used in this annotation.doubleThe Destination for this link.The Highlighstyle for this link.voidThe Action object for this link.voidsetAnnotationFeatureLevel(double featureLevel) Removes features not supported in the supplied version number.voidsetBorderStyle(String style) voidsetBorderStyleDashPattern(List<Double> dashPattern) voidsetBorderStyleWidth(double width) voidsetDestination(ViewDestination newdest) The Destination for this link.voidsetHighlight(HighlightStyle style) The Highlighstyle for this link.Methods inherited from class com.datalogics.PDFL.Annotation
equals, getColor, getContents, getFlags, getInteriorColor, getNormalAppearance, getOpacity, getOptionalContentMembershipDict, getPDFDict, getRect, getSubtype, getTitle, hasRichTextData, isCurrentlyVisible, setColor, setContents, setFlags, setInteriorColor, setNormalAppearance, setOpacity, setOptionalContentMembershipDict, setRect, setTitle, toString
-
Constructor Details
-
LinkAnnotation
Create a new LinkAnnotation at the end of a page's annotation array. To create a LinkAnnotation and place it elsewhere in the page's annotation array, use the version of the constructor that takes an array position.- Parameters:
page- The page to which the LinkAnnotation is added.initialRect- A rectangle specifying the annotation's bounds, specified in user space coordinates.
-
LinkAnnotation
Create a new LinkAnnotation at a specific index in the page's annotation array.- Parameters:
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.
-
-
Method Details
-
delete
public void delete()- Overrides:
deletein classAnnotation
-
getAction
The Action object for this link.Note that setting the Action will wipe out the Link's Destination member a link annotation cannot have both members.
-
setAction
The Action object for this link.Note that setting the Action will wipe out the Link's Destination member a link annotation cannot have both members.
-
getDestination
The Destination for this link.Note that setting the Destination will wipe out the Link's Action member a link annotation cannot have both members.
-
setDestination
The Destination for this link.Note that setting the Destination will wipe out the Link's Action member a link annotation cannot have both members.
-
getHighlight
The Highlighstyle for this link. -
setHighlight
The Highlighstyle for this link. -
generateAppearance
Generate a new appearance stream with the current annotation properties.The resulting Form can then be used to set the annotation's appearance, such as by calling SetNormalAppearance.
- Overrides:
generateAppearancein classAnnotation
-
getAnnotationFeatureLevel
public double getAnnotationFeatureLevel()The minimum PDF version necessary to support the features used in this annotation.- Overrides:
getAnnotationFeatureLevelin classAnnotation
-
setAnnotationFeatureLevel
public void setAnnotationFeatureLevel(double featureLevel) Removes features not supported in the supplied version number.- Overrides:
setAnnotationFeatureLevelin classAnnotation
-
copyTo
Copy a LinkAnnotation to the specified page. The annotation will be centered on the page. To center the annotation at a specific point, use the version of this method that accepts a Point.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.
- Parameters:
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.- Returns:
- the annotation created on the destination page.
-
copyTo
Copy a LinkAnnotation to the specified page and center the annotation on the specified point.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.
- Parameters:
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.- Returns:
- the annotation created on the destination page.
-
getBorderStyleWidth
public double getBorderStyleWidth() -
setBorderStyleWidth
public void setBorderStyleWidth(double width) -
getBorderStyle
-
setBorderStyle
-
getBorderStyleDashPattern
-
setBorderStyleDashPattern
-