com.crionics.jpdf.annotation
Class LinkAnnotation

java.lang.Object
  extended by PdfObjectContainer
      extended by com.crionics.jpdf.annotation.AbstractAnnotation
          extended by com.crionics.jpdf.annotation.LinkAnnotation

public class LinkAnnotation
extends AbstractAnnotation

A link annotation represents either a hypertext link to a destination elsewhere in the document or an action to be performed when activated.


Field Summary
static int HIGHLIGHT_INVERT
          Invert the contents of the annotation rectangle.
static int HIGHLIGHT_NONE
          No highlighting will be done.
static int HIGHLIGHT_OUTLINE
          Invert the annotation’s border.
static int HIGHLIGHT_PUSH
          Display the annotation as if it were being pushed below the surface of the page.
 
Method Summary
static LinkAnnotation createInstance(PdfDocument doc)
          Allows the creation of a new Link Annotation into the Specified document.
 AbstractAction getAction()
          Returns the Action associated with this link annotation.
 LocalPageDestination getDestination()
          Returns the destination currently registered with this Link Annotation.
 int getHighlightMode()
          Returns the current visual effect to be used by a PDF Viewer application when the mouse button is pressed or held down inside the active area of the Link Annotation.
 void setAction(AbstractAction action)
          Sets the Action to be associated with this link annotation.
 void setDestination(LocalPageDestination destination)
          Sets the destination currently to be registered with this action.
 void setHighlightMode(int mode)
          Sets the visual effect to be used by a PDF Viewer application when the mouse button is pressed or held down inside the active area of the Link Annotation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HIGHLIGHT_INVERT

public static final int HIGHLIGHT_INVERT
Invert the contents of the annotation rectangle.


HIGHLIGHT_NONE

public static final int HIGHLIGHT_NONE
No highlighting will be done.


HIGHLIGHT_OUTLINE

public static final int HIGHLIGHT_OUTLINE
Invert the annotation’s border.


HIGHLIGHT_PUSH

public static final int HIGHLIGHT_PUSH
Display the annotation as if it were being pushed below the surface of the page.

Method Detail

createInstance

public static LinkAnnotation createInstance(PdfDocument doc)
                                     throws PdfException,
                                            java.io.IOException
Allows the creation of a new Link Annotation into the Specified document.

The usage of this method requires the acquision of the Module jPDF Creator or jPDF Template

Parameters:
doc - The Document into which the Annotation should be created.
Returns:
The action created.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

getAction

public AbstractAction getAction()
                         throws PdfException,
                                java.io.IOException
Returns the Action associated with this link annotation.

Note: Action and Destination are mutually exclusive in Link annotation. Both can not be set on the same object.

Returns:
The Action
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

getDestination

public LocalPageDestination getDestination()
                                    throws PdfException,
                                           java.io.IOException
Returns the destination currently registered with this Link Annotation.

Note: Action and Destination are mutually exclusive in Link annotation. Both can not be set on the same object.

Returns:
The destination.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

getHighlightMode

public int getHighlightMode()
                     throws PdfException,
                            java.io.IOException
Returns the current visual effect to be used by a PDF Viewer application when the mouse button is pressed or held down inside the active area of the Link Annotation.

Returns:
The highlight mode (one of the HIGHLIGHT_XXX Constant defined in this object).
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

setAction

public void setAction(AbstractAction action)
               throws PdfException,
                      java.io.IOException
Sets the Action to be associated with this link annotation.

Note: Action and Destination are mutually exclusive in Link annotation. Both can not be set on the same object.

Parameters:
action - The Action to be set
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

setDestination

public void setDestination(LocalPageDestination destination)
                    throws PdfException,
                           java.io.IOException
Sets the destination currently to be registered with this action.

Note: Action and Destination are mutually exclusive in Link annotation. Both can not be set on the same object.

Parameters:
destination - The destination object.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

setHighlightMode

public void setHighlightMode(int mode)
                      throws PdfException,
                             java.io.IOException
Sets the visual effect to be used by a PDF Viewer application when the mouse button is pressed or held down inside the active area of the Link Annotation.

Parameters:
mode - The highlight mode (one of the HIGHLIGHT_XXX Constant defined in this object).
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.


Copyright © 1999-2007 Crionics. All Rights Reserved.