|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.faceless.pdf2.PDFAnnotation
org.faceless.pdf2.AnnotationLink
public final class AnnotationLink
A subtype new PDFAnnotation
that performs the specified action
when clicked. This can be used to create an HTML-style hyperlink,
play a sound, or perform some other PDFAction
.
Constructor Summary | |
---|---|
AnnotationLink()
Create a new Link annotation with a default setStyle(org.faceless.pdf2.PDFStyle) of null |
Method Summary | |
---|---|
PDFAction |
getAction()
Return the action performed by this hyperlink |
float[] |
getCorners()
Return the corners of the Annotation as specified by setCorners() . |
float[] |
getRectangle()
Return the rectangle this annotation applies to on the page, or null if no rectangle applies for this type of annotation. |
PDFStyle |
getStyle()
Returns the style used to draw the link on the page. |
void |
setAction(PDFAction action)
Set the action for this hyperlink |
void |
setCorners(float[] corners)
Set a series of corners of the quadrilateral(s) that encompass the text underlying this annotation. |
void |
setCorners(float x1,
float y1,
float x2,
float y2,
float x3,
float y3,
float x4,
float y4)
Set the four corners (x1,y1) (x2,y2) (x3,y3) (x4,y4) of the quadrilateral that encompasses the text underlying this annotation. |
void |
setRectangle(float x1,
float y1,
float x2,
float y2)
Set the rectangle for the annotation - where it is on the page. |
void |
setStyle(PDFStyle style)
Set the style for this hyperlink annotation. |
String |
toString()
|
Methods inherited from class org.faceless.pdf2.PDFAnnotation |
---|
addPropertyChangeListener, addReview, flatten, getAuthor, getColor, getContents, getCreationDate, getInReplyTo, getMetaData, getModifyDate, getOpacity, getPage, getPopup, getReplies, getReviews, getSubject, getType, getUniqueID, hasAppearanceState, isContentLocked, isPositionLocked, isPrintable, isReadOnly, isVisible, rebuild, removePropertyChangeListener, setAuthor, setColor, setContents, setCreationDate, setInReplyTo, setLocked, setMetaData, setModifyDate, setOpacity, setPage, setPrintable, setReadOnly, setSubject, setUniqueID, setVisible |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AnnotationLink()
setStyle(org.faceless.pdf2.PDFStyle)
of null
Method Detail |
---|
public void setAction(PDFAction action)
public PDFAction getAction()
public float[] getRectangle()
PDFAnnotation
setRectangle()
method for a discussion on units.
getRectangle
in class PDFAnnotation
PDFAnnotation.setRectangle(float, float, float, float)
public void setStyle(PDFStyle style)
Set the style for this hyperlink annotation. Parameters from the style
that are used include LineColor
,
DashPattern
,
LineWeighting
and
FormStyle
(although Acrobat 4 and earlier
will ignore the FormStyle)
Alternatively the style may be null
to prevent
this link having any visible appearance on the page
style
- the style to draw the link in - may be null
public PDFStyle getStyle()
setStyle(org.faceless.pdf2.PDFStyle)
public void setCorners(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
setRectangle(org.faceless.pdf2.LayoutBox.Box, float, float)
as well as this method.
x1
- the X co-ordinate of the bottom-left corner of the texty1
- the Y co-ordinate of the bottom-left corner of the textx2
- the X co-ordinate of the bottom-right corner of the texty2
- the Y co-ordinate of the bottom-right corner of the textx3
- the X co-ordinate of the top-left corner of the texty3
- the Y co-ordinate of the top-left corner of the textx4
- the X co-ordinate of the top-right corner of the texty4
- the Y co-ordinate of the top-right corner of the textpublic void setCorners(float[] corners)
setCorners()
method.
The supplied array must be 8xn long, specifying the n quadrilaterals
that make up the annotation. If these points to not define a sequence of (possibly rotated)
rectangle shapes, the results are undefined.
corners
- an array of 8xn values, each group of 8 specified as (x1,y1, x2,y2, x3,y3, x4,y4)public void setRectangle(float x1, float y1, float x2, float y2)
PDFAnnotation
AnnotationLink
and AnnotationStamp
annotations, this is
the rectangle containing the hyperlink area or stamp.AnnotationNote
annotations, whether this method adjusts the location
of the icon or the popup window depends on whether the annotation is closed or open
at the time of the call to this method. When closed, the icon is positioned at x1,y2
Note that all co-ordinates are in absolute page co-ordinates.
This means they are measured in points from the bottom-left hand
corner of the page, regardless of any calls to PDFPage.rotate(float, float, double)
or PDFPage.setUnits(float, int)
that have been made. This restriction is
part of the PDF specification.
setRectangle
in class PDFAnnotation
x1
- the X co-ordinate of the bottom-left corner of the rectangley1
- the Y co-ordinate of the bottom-left corner of the rectanglex2
- the X co-ordinate of the top-right corner of the rectangley2
- the Y co-ordinate of the top-right corner of the rectanglepublic float[] getCorners()
setCorners()
.
setCorners()
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |