|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.faceless.pdf2.PDFObject
org.faceless.pdf2.PDFMap
org.faceless.pdf2.PDFAnnotation
A PDFAnnotation allows the user to interact with the generated
PDF document, by adding / viewing rubber-stamps, popup notes
hyperlinks and so on. A special subclass of annotation, called a Widget,
is also used to display FormElement
objects on the page.
Since version 2.0, the various types of annotation have been split into
unique subclasses. This class contains the methods that are common to
all of them.
Method Summary | |
boolean |
equals(Object o)
|
Calendar |
getCreationDate()
Return the date when the annotation was first created if specified, or null otherwise. |
PDFAnnotation |
getInReplyTo()
Return the PDFAnnotation that this annotation is in reply to, or null if not specified. |
Calendar |
getModifyDate()
Return the date when the annotation was last modified if specified, or null otherwise. |
PDFPage |
getPage()
Return the page that this annotation is on, or null
if it a new annotation which has not yet been placed on a page |
float[] |
getRectangle()
Return the rectangle this annotation applies to on the page, or null if no rectangle applies for this type of annotation. |
String |
getSubject()
Get the subject of the annotation, as set by setSubject(java.lang.String) |
String |
getType()
Return the type of annotation. |
String |
getUniqueID()
Return the unique ID for this annotation, if set. |
boolean |
isPrintable()
Returns whether the annotation is included when the document is printed (true) or not (false) |
boolean |
isReadOnly()
Return whether the annotation to "read-only". |
boolean |
isVisible()
Returns whether the annotation is visible on the screen (true) or not (false) |
void |
setInReplyTo(PDFAnnotation annotation)
Set which annotation this annotation is in reply to. |
void |
setPage(PDFPage page)
Set the page for this annotation. |
void |
setPrintable(boolean printable)
Set whether the annotation is included when the document is printed. |
void |
setReadOnly(boolean readonly)
Set the annotation to "read-only", or not. |
void |
setRectangle(float x1,
float y1,
float x2,
float y2)
Set the rectangle for the annotation. |
void |
setSubject(String subject)
Set the subject of the annotation. |
void |
setUniqueID(String id)
Set the unique ID for this annotation. |
void |
setVisible(boolean visible)
Set whether the annotation is visible on screen. |
String |
toString()
|
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public void setRectangle(float x1, float y1, float x2, float y2)
AnnotationLink
and AnnotationStamp
annotations, this is
the rectangle containing the hyperlink area or stamp.AnnotationNote
annotations, this is the rectangle describing the popup
window when it's opened. When it's closed, the icon is positioned at x1,y1.
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.
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[] getRectangle()
setRectangle()
method for a discussion on units.
setRectangle(float, float, float, float)
public String getSubject()
setSubject(java.lang.String)
public void setSubject(String subject)
subject
- a brief summary of the contents of the annotationpublic PDFPage getPage()
null
if it a new annotation which has not yet been placed on a page
public void setPage(PDFPage page)
PDFPage.getAnnotations()
.add()
public void setVisible(boolean visible)
visible
- whether the annotation should be displayed on the screenpublic void setPrintable(boolean printable)
printable
- whether the annotation should be printedpublic boolean isVisible()
public boolean isPrintable()
public boolean isReadOnly()
Return whether the annotation to "read-only". Read-only annotations cannot be moved or deleted and do not respond to mouse clicks in Acrobat.
Note this value is ignored for WidgetAnnotation
objects - see the
FormElement.isReadOnly()
method instead.
setReadOnly(boolean)
,
FormElement.isReadOnly()
public void setReadOnly(boolean readonly)
Set the annotation to "read-only", or not. Read-only annotations cannot be moved or deleted and do not respond to mouse clicks in Acrobat
Additionally, using Acrobat there is no way to change this flag, so fields set to read-only using this method will basically stay that way unless edited with an API like this one. This makes this setting useful for placing "permanent" annotations on a page.
Note this value is ignored for WidgetAnnotation
objects - see the
FormElement.setReadOnly(boolean)
method instead
public Calendar getModifyDate()
null
otherwise.
getLastModified
public Calendar getCreationDate()
null
otherwise. Note for annotations not created
with Acrobat 6 or later, this will be the same Date as getModifyDate()
public String getType()
AnnotationNote
s), "Link",
(for AnnotationLink
s), "Stamp" (for AnnotationStamp
s), "Widget"
(for WidgetAnnotation
s), or "FreeText", "Line", "Square", "Circle", "Polygon", "Polyline",
"Highlight", "Underline", "Squiggly", "StrikeOut", "Caret", "Ink", "Popup", "FileAttachment", "Sound",
"Movie", "Screen", "PrinterMark" or "TrapNet", all of which only have only basic support
with this API.
public PDFAnnotation getInReplyTo()
null
if not specified. Note for annotations not created
with Acrobat 6 or later, this will always be null
public String getUniqueID()
public void setUniqueID(String id)
getUniqueID()
method
for more information. Note that it is down to the user to ensure that the
unique ID generated is actually unique.
id
- the unique ID to assign to this annotationpublic void setInReplyTo(PDFAnnotation annotation)
annotation
- the annotation this is in reply to, or null
to remove
the current valuepublic String toString()
public boolean equals(Object o)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |