Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.interactive.annotation

public Class PDAnnotationLink

extends PDAnnotation
Class Inheritance
Imports
java.io.IOException, org.apache.pdfbox.cos.COSArray, .COSDictionary, .COSName, org.apache.pdfbox.pdmodel.PDDocument, org.apache.pdfbox.pdmodel.interactive.action.PDActionFactory, .PDAction, .PDActionURI, org.apache.pdfbox.pdmodel.interactive.annotation.handlers.PDAppearanceHandler, .PDLinkAppearanceHandler, org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination

This is the class that represents a link annotation.
Authors
Ben Litchfield, Paul King

Field Summary

Modifier and TypeField and Description
private PDAppearanceHandler
customAppearanceHandler

Custom appearance handler to generate an appearance stream.

public static final String
HIGHLIGHT_MODE_INVERT

Constant values of the Text as defined in the PDF 1.6 reference Table 8.19.

public static final String
HIGHLIGHT_MODE_NONE

Constant values of the Text as defined in the PDF 1.6 reference Table 8.19.

public static final String
HIGHLIGHT_MODE_OUTLINE

Constant values of the Text as defined in the PDF 1.6 reference Table 8.19.

public static final String
HIGHLIGHT_MODE_PUSH

Constant values of the Text as defined in the PDF 1.6 reference Table 8.19.

public static final String
SUB_TYPE

The type of annotation.

Constructor Summary

AccessConstructor and Description

Method Summary

Modifier and TypeMethod and Description
public void
public void
constructAppearances(PDDocument
the related document
document
)

Overrides org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation.constructAppearances.

Create the appearance entry for this annotation.

public PDAction

Returns:

The action to be performed when this annotation is activated.
getAction
()

Get the action to be performed when this annotation is to be activated.

public PDBorderStyleDictionary

Returns:

the border style dictionary.
getBorderStyle
()

This will retrieve the border style dictionary, specifying the width and dash pattern used in drawing the line.

public PDDestination

Returns:

The destination for this annotation.
getDestination
()

Get the destination to be displayed when the annotation is activated.

public String

Returns:

The string representation of the highlight mode.
getHighlightMode
()

Set the highlight mode for when the mouse is depressed.

public PDActionURI

Returns:

The previous URI.
getPreviousURI
()

This will set the previous URI action, in case it's needed.

public float[]

Returns:

An array of floats representing the quad points.
getQuadPoints
()

This will retrieve the set of quadpoints which encompass the areas of this annotation which will activate.

public void
setAction(PDAction
The annotation action.
action
)

Set the annotation action.

public void
setBorderStyle(PDBorderStyleDictionary
the border style dictionary to set.
bs
)

This will set the border style dictionary, specifying the width and dash pattern used in drawing the line.

public void
setCustomAppearanceHandler(PDAppearanceHandler
custom appearance handler
appearanceHandler
)

Set a custom appearance handler for generating the annotations appearance streams.

public void
setDestination(PDDestination
The updated destination.
dest
)

The new destination value.

public void
setHighlightMode(String
The new highlight mode.
mode
)

Set the highlight mode.

public void
setPreviousURI(PDActionURI
The previous URI.
pa
)

This will set the previous URI action, in case it needs to be retrieved at later date.

public void
setQuadPoints(float[]
an array representing the set of area covered.
quadPoints
)

This will set the set of quadpoints which encompass the areas of this annotation which will activate.

Inherited from org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation:
createAnnotationequalsgetAnnotationFlagsgetAnnotationNamegetAppearancegetAppearanceStategetBordergetColorgetColorgetContentsgetCOSObjectgetModifiedDategetNormalAppearanceStreamgetOptionalContentgetPagegetRectanglegetStructParentgetSubtypehashCodeisHiddenisInvisibleisLockedisLockedContentsisNoRotateisNoViewisNoZoomisPrintedisReadOnlyisToggleNoViewsetAnnotationFlagssetAnnotationNamesetAppearancesetAppearanceStatesetBordersetColorsetContentssetHiddensetInvisiblesetLockedsetLockedContentssetModifiedDatesetModifiedDatesetNoRotatesetNoViewsetNoZoomsetOptionalContentsetPagesetPrintedsetReadOnlysetRectanglesetStructParentsetSubtypesetToggleNoView

Field Detail

customAppearanceHandlerback to summary
private PDAppearanceHandler customAppearanceHandler

Custom appearance handler to generate an appearance stream.

HIGHLIGHT_MODE_INVERTback to summary
public static final String HIGHLIGHT_MODE_INVERT

Constant values of the Text as defined in the PDF 1.6 reference Table 8.19.

HIGHLIGHT_MODE_NONEback to summary
public static final String HIGHLIGHT_MODE_NONE

Constant values of the Text as defined in the PDF 1.6 reference Table 8.19.

HIGHLIGHT_MODE_OUTLINEback to summary
public static final String HIGHLIGHT_MODE_OUTLINE

Constant values of the Text as defined in the PDF 1.6 reference Table 8.19.

HIGHLIGHT_MODE_PUSHback to summary
public static final String HIGHLIGHT_MODE_PUSH

Constant values of the Text as defined in the PDF 1.6 reference Table 8.19.

SUB_TYPEback to summary
public static final String SUB_TYPE

The type of annotation.

Constructor Detail

Method Detail

constructAppearancesback to summary
public void constructAppearances()

Overrides org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation.constructAppearances.

Doc from org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation.constructAppearances.

Create the appearance entry for this annotation. Not having it may prevent display in some viewers. This method is for overriding in subclasses, the default implementation does nothing.

Annotations
@Override
constructAppearancesback to summary
public void constructAppearances(PDDocument document)

Overrides org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation.constructAppearances.

Doc from org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation.constructAppearances.

Create the appearance entry for this annotation. Not having it may prevent display in some viewers. This method is for overriding in subclasses, the default implementation does nothing.

Parameters
document:PDDocument

the related document

Annotations
@Override
getActionback to summary
public PDAction getAction()

Get the action to be performed when this annotation is to be activated. Either this or the destination entry should be set, but not both.

Returns:PDAction

The action to be performed when this annotation is activated.

getBorderStyleback to summary
public PDBorderStyleDictionary getBorderStyle()

This will retrieve the border style dictionary, specifying the width and dash pattern used in drawing the line.

Returns:PDBorderStyleDictionary

the border style dictionary.

getDestinationback to summary
public PDDestination getDestination() throws IOException

Get the destination to be displayed when the annotation is activated. Either this or the action entry should be set, but not both.

Returns:PDDestination

The destination for this annotation.

Exceptions
IOException:
If there is an error creating the destination.
getHighlightModeback to summary
public String getHighlightMode()

Set the highlight mode for when the mouse is depressed. See the HIGHLIGHT_MODE_XXX constants.

Returns:String

The string representation of the highlight mode.

getPreviousURIback to summary
public PDActionURI getPreviousURI()

This will set the previous URI action, in case it's needed.

Returns:PDActionURI

The previous URI.

getQuadPointsback to summary
public float[] getQuadPoints()

This will retrieve the set of quadpoints which encompass the areas of this annotation which will activate.

Returns:float[]

An array of floats representing the quad points.

setActionback to summary
public void setAction(PDAction action)

Set the annotation action. Either this or the destination entry should be set, but not both.

Parameters
action:PDAction

The annotation action.

setBorderStyleback to summary
public void setBorderStyle(PDBorderStyleDictionary bs)

This will set the border style dictionary, specifying the width and dash pattern used in drawing the line.

Parameters
bs:PDBorderStyleDictionary

the border style dictionary to set.

setCustomAppearanceHandlerback to summary
public void setCustomAppearanceHandler(PDAppearanceHandler appearanceHandler)

Set a custom appearance handler for generating the annotations appearance streams.

Parameters
appearanceHandler:PDAppearanceHandler

custom appearance handler

setDestinationback to summary
public void setDestination(PDDestination dest)

The new destination value. Either this or the action entry should be set, but not both.

Parameters
dest:PDDestination

The updated destination.

setHighlightModeback to summary
public void setHighlightMode(String mode)

Set the highlight mode. See the HIGHLIGHT_MODE_XXX constants.

Parameters
mode:String

The new highlight mode.

setPreviousURIback to summary
public void setPreviousURI(PDActionURI pa)

This will set the previous URI action, in case it needs to be retrieved at later date.

Parameters
pa:PDActionURI

The previous URI.

setQuadPointsback to summary
public void setQuadPoints(float[] quadPoints)

This will set the set of quadpoints which encompass the areas of this annotation which will activate.

Parameters
quadPoints:float[]

an array representing the set of area covered.