public class Annot
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Annot.BorderStyle
BorderStyle structure specifies the characteristics of the annotation?s border.
|
Modifier and Type | Field and Description |
---|---|
static int |
e_3D
The Constant e_3D.
|
static int |
e_action_trigger_activate
Triggered when the annotation is activated.
|
static int |
e_action_trigger_annot_blur
Triggered when the annotation loses the input focus
|
static int |
e_action_trigger_annot_down
Triggered when the mouse button is pressed inside the annotation’s active area
|
static int |
e_action_trigger_annot_enter
Triggered when the cursor enters the annotation's active area
|
static int |
e_action_trigger_annot_exit
Triggered when the cursor exits the annotation's active area
|
static int |
e_action_trigger_annot_focus
Triggered when the annotation receives the input focus
|
static int |
e_action_trigger_annot_page_close
Triggered when the page containing the annotation is closed
|
static int |
e_action_trigger_annot_page_invisible
Triggered when the page containing the annotation is no longer visible in the interactive PDF processor’s user interface
|
static int |
e_action_trigger_annot_page_open
Triggered when the page containing the annotation is opened
|
static int |
e_action_trigger_annot_page_visible
Triggered when the page containing the annotation becomes visible
|
static int |
e_action_trigger_annot_up
Triggered when the mouse button is released inside the annotation’s active area
|
static int |
e_Caret
The Constant e_Caret.
|
static int |
e_Circle
The Constant e_Circle.
|
static int |
e_down
The Constant e_down.
|
static int |
e_FileAttachment
The Constant e_FileAttachment.
|
static int |
e_FreeText
The Constant e_FreeText.
|
static int |
e_hidden
The Constant e_hidden.
|
static int |
e_Highlight
The Constant e_Highlight.
|
static int |
e_Ink
The Constant e_Ink.
|
static int |
e_invisible
Flags specifying various characteristics of the annotation.
|
static int |
e_Line
The Constant e_Line.
|
static int |
e_Link
The Constant e_Link.
|
static int |
e_locked
The Constant e_locked.
|
static int |
e_locked_contents
The Constant e_locked_contents.
|
static int |
e_Movie
The Constant e_Movie.
|
static int |
e_no_rotate
The Constant e_no_rotate.
|
static int |
e_no_view
The Constant e_no_view.
|
static int |
e_no_zoom
The Constant e_no_zoom.
|
static int |
e_normal
An annotation can define as many as three separate appearances:
The normal appearance is used when the annotation is not interacting
with the user.
|
static int |
e_Polygon
The Constant e_Polygon.
|
static int |
e_Polyline
The Constant e_Polyline.
|
static int |
e_Popup
The Constant e_Popup.
|
static int |
e_print
The Constant e_print.
|
static int |
e_PrinterMark
The Constant e_PrinterMark.
|
static int |
e_Projection
The Constant e_Projection.
|
static int |
e_read_only
The Constant e_read_only.
|
static int |
e_Redact
The Constant e_Redact.
|
static int |
e_RichMedia
The Constant e_RichMedia.
|
static int |
e_rollover
The Constant e_rollover.
|
static int |
e_Screen
The Constant e_Screen.
|
static int |
e_Sound
The Constant e_Sound.
|
static int |
e_Square
The Constant e_Square.
|
static int |
e_Squiggly
The Constant e_Squiggly.
|
static int |
e_Stamp
The Constant e_Stamp.
|
static int |
e_StrikeOut
The Constant e_StrikeOut.
|
static int |
e_Text
PDF supports the standard annotation types listed in the following enumeration (plug-in extensions may add new annotation types):.
|
static int |
e_toggle_no_view
The Constant e_toggle_no_view.
|
static int |
e_TrapNet
The Constant e_TrapNet.
|
static int |
e_Underline
The Constant e_Underline.
|
static int |
e_Unknown
The Constant e_Unknown.
|
static int |
e_Watermark
The Constant e_Watermark.
|
static int |
e_Widget
The Constant e_Widget.
|
Constructor and Description |
---|
Annot()
Create an empty annotation.
|
Annot(Obj d)
Create an annotation and initialize it using given Cos/SDF object.
|
Modifier and Type | Method and Description |
---|---|
static Annot |
__Create(long impl,
java.lang.Object ref) |
long |
__GetHandle() |
java.lang.Object |
__GetRefHandle() |
static Annot |
create(Doc doc,
int type,
Rect pos)
Creates a new annotation of a given type, in the specified document.
|
boolean |
equals(java.lang.Object d)
Compares two annotations for equality.
|
void |
flatten(Page page)
Flatten/Merge the existing annotation appearances with the page content and
delete this annotation from a given page.
|
java.lang.String |
getActiveAppearanceState()
Get the annotation?s active appearance state.
|
Obj |
getAppearance()
Get the annotation?s appearance for the given combination of annotation
and appearance states.
|
Obj |
getAppearance(int annot_state)
Get the annotation?s appearance for the given combination of annotation
and appearance states.
|
Obj |
getAppearance(int annot_state,
java.lang.String app_state)
Get the annotation?s appearance for the given combination of annotation
and appearance states.
|
Annot.BorderStyle |
getBorderStyle()
Get the border style for the annotation.
|
ColorPt |
getColorAsCMYK()
Get an annotation's color.
|
ColorPt |
getColorAsGray()
Get an annotation's color.
|
ColorPt |
getColorAsRGB()
Get an annotation's color.
|
int |
getColorCompNum()
Get the color space the annotation's color is represented in.
|
java.lang.String |
getContents()
Get the annotation contents.
|
Date |
getDate()
Gets an annotation's last modified date.
|
boolean |
getFlag(int flag)
Determine if the give flag is marked flagged
|
Obj |
getOptionalContent()
Get optional content of an annotation.
|
Page |
getPage()
Get the page the annotation is associated with.
|
Rect |
getRect()
Get annoation bound rectangle
|
int |
getRotation()
Get the rotation value of the annotation.
|
Obj |
getSDFObj()
Get the SDFObj.
|
int |
GetStructParent()
Get the struct parent of an annotation.
|
Obj |
getTriggerAction(int trigger)
Get the Action associated with the selected Annot Trigger event.
|
int |
getType()
Get the annotation type.
|
Obj |
getUniqueID()
Get the annotiation unique ID.
|
Rect |
getVisibleContentBox()
It is possible during viewing that GetRect does not return the most accurate bounding box
of what is actually rendered.
|
boolean |
isMarkup()
Checks if annoation is markup.
|
boolean |
isValid()
Checks if Annot is valid.
|
void |
refreshAppearance()
Regenerates the appearance stream for the annotation.
|
void |
removeAppearance(int annot_state,
java.lang.String app_state)
Removes the annotation's appearance for the given combination of annotation
and appearance states.
|
void |
resize(Rect pos)
Resize annotation
|
void |
setActiveAppearanceState(java.lang.String astate)
Set the annotation?s active appearance state.
|
void |
setAppearance(Obj app_stream)
Set the annotation?s appearance for the given combination of annotation
and appearance states.
|
void |
setAppearance(Obj app_stream,
int annot_state)
Set the annotation?s appearance for the given combination of annotation
and appearance states.
|
void |
setAppearance(Obj app_stream,
int annot_state,
java.lang.String app_state)
Set the annotation?s appearance for the given combination of annotation
and appearance states.
|
void |
setBorderStyle(Annot.BorderStyle bs)
Set the border style for the annotation.
|
void |
setColor(ColorPt cpt,
int comp_num)
Set an annotation's color.
|
void |
setContents(java.lang.String ct)
Set annotation contents.
|
void |
setDate(Date date)
Sets an annotation's last modified date.
|
void |
setFlag(int flag,
boolean value)
Set the value of given Flag.
|
void |
setOptionalContent(Obj oc)
Set optional content of an annotation.
|
void |
setPage(Page page)
Set the reference to a page the annotation is associated with.
|
void |
setRect(Rect pos)
Set the size and location of an annotation on its page.
|
void |
setRotation(int rot)
Set the rotation value of the annotation.
|
void |
setStructParent(int keyval)
Set the struct parent of an annotation.
|
void |
setUniqueID(java.lang.String icon_name)
Set the unique identifier for this annotation.
|
public static final int e_Text
public static final int e_Link
public static final int e_FreeText
public static final int e_Line
public static final int e_Square
public static final int e_Circle
public static final int e_Polygon
public static final int e_Polyline
public static final int e_Highlight
public static final int e_Underline
public static final int e_Squiggly
public static final int e_StrikeOut
public static final int e_Stamp
public static final int e_Caret
public static final int e_Ink
public static final int e_Popup
public static final int e_FileAttachment
public static final int e_Sound
public static final int e_Movie
public static final int e_Widget
public static final int e_Screen
public static final int e_PrinterMark
public static final int e_TrapNet
public static final int e_Watermark
public static final int e_3D
public static final int e_Redact
public static final int e_Projection
public static final int e_RichMedia
public static final int e_Unknown
public static final int e_action_trigger_activate
public static final int e_action_trigger_annot_enter
public static final int e_action_trigger_annot_exit
public static final int e_action_trigger_annot_down
public static final int e_action_trigger_annot_up
public static final int e_action_trigger_annot_focus
public static final int e_action_trigger_annot_blur
public static final int e_action_trigger_annot_page_open
public static final int e_action_trigger_annot_page_close
public static final int e_action_trigger_annot_page_visible
public static final int e_action_trigger_annot_page_invisible
public static final int e_invisible
public static final int e_hidden
public static final int e_print
public static final int e_no_zoom
public static final int e_no_rotate
public static final int e_no_view
public static final int e_read_only
public static final int e_locked
public static final int e_toggle_no_view
public static final int e_locked_contents
public static final int e_normal
public static final int e_rollover
public static final int e_down
public Annot(Obj d)
Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.
d
- the dpublic Annot()
public static Annot create(Doc doc, int type, Rect pos) throws PDFNetException
doc
- A document to which the annotation is added.type
- Subtype of annotation to create.pos
- A rectangle specifying the annotation's bounds, specified in
user space coordinates.PDFNetException
public Obj getTriggerAction(int trigger) throws PDFNetException
trigger
- the type of trigger event to getPDFNetException
public boolean equals(java.lang.Object d)
equals
in class java.lang.Object
d
- the other annotationpublic boolean isValid() throws PDFNetException
PDFNetException
public Obj getSDFObj() throws PDFNetException
PDFNetException
public int getType() throws PDFNetException
PDFNetException
public boolean isMarkup() throws PDFNetException
PDFNetException
public java.lang.String getContents() throws PDFNetException
PDFNetException
public void setContents(java.lang.String ct) throws PDFNetException
ct
- the new contentsPDFNetException
public Rect getRect() throws PDFNetException
PDFNetException
public Rect getVisibleContentBox() throws PDFNetException
PDFNetException
public void setRect(Rect pos) throws PDFNetException
pos
- the new bound rectanglePDFNetException
public Page getPage() throws PDFNetException
PDFNetException
public void setPage(Page page) throws PDFNetException
Note: The parameter should be an indirect reference to the page object with which this annotation is associated. This entry shall be present in screen annotations associated with rendition actions
page
- the new pagePDFNetException
public Obj getUniqueID() throws PDFNetException
PDFNetException
public void setUniqueID(java.lang.String icon_name) throws PDFNetException
Note: It is necessary to ensure that the unique ID generated is actually unique.
icon_name
- the new unique idPDFNetException
public Date getDate() throws PDFNetException
PDFNetException
public void setDate(Date date) throws PDFNetException
date
- The annotation's last modified time and date. Corresponds to the "M" entry of the
annotation dictionary.PDFNetException
public boolean getFlag(int flag) throws PDFNetException
flag
- The Flag property to query.PDFNetException
public void setFlag(int flag, boolean value) throws PDFNetException
flag
- The Flag property to modify.value
- The new value for the property.PDFNetException
public Annot.BorderStyle getBorderStyle() throws PDFNetException
PDFNetException
public void setBorderStyle(Annot.BorderStyle bs) throws PDFNetException
bs
- New border style for this annotation.PDFNetException
public Obj getAppearance() throws PDFNetException
PDFNetException
public Obj getAppearance(int annot_state) throws PDFNetException
annot_state
- The annotation?s appearance state, which selects the applicable
appearance stream from the appearance sub-dictionary. An annotation can define as many
as three separate appearances: The normal, rollover, and down appearance.PDFNetException
public Obj getAppearance(int annot_state, java.lang.String app_state) throws PDFNetException
annot_state
- The annotation?s appearance state, which selects the applicable
appearance stream from the appearance sub-dictionary. An annotation can define as many
as three separate appearances: The normal, rollover, and down appearance.app_state
- Is an optional parameter specifying the appearance state
to look for (e.g. "Off", "On", etc). If appearance_state is NULL, the choice
between different appearance states is determined by the AS (Appearance State)
entry in the annotation dictionary.PDFNetException
public void setAppearance(Obj app_stream) throws PDFNetException
app_stream
- a content stream defining the new appearance.PDFNetException
public void removeAppearance(int annot_state, java.lang.String app_state) throws PDFNetException
annot_state
- the annotation's appearance state, which selects the applicable
appearance stream from the appearance sub-dictionary. An annotation can define as many
as three separate appearances: The normal, rollover, and down appearance.app_state
- is an optional parameter specifying the appearance state
(e.g. "Off", "On", etc) under which the new appearance should be stored. If
appearance_state is NULL, the annotation will have only one annotaion state.PDFNetException
public void setAppearance(Obj app_stream, int annot_state) throws PDFNetException
app_stream
- a content stream defining the new appearance.annot_state
- the annotation?s appearance state, which selects the applicable
appearance stream from the appearance sub-dictionary. An annotation can define as many
as three separate appearances: The normal, rollover, and down appearance.PDFNetException
public void setAppearance(Obj app_stream, int annot_state, java.lang.String app_state) throws PDFNetException
app_stream
- a content stream defining the new appearance.annot_state
- the annotation?s appearance state, which selects the applicable
appearance stream from the appearance sub-dictionary. An annotation can define as many
as three separate appearances: The normal, rollover, and down appearance.app_state
- is an optional parameter specifying the appearance state
(e.g. "Off", "On", etc) under which the new appearance should be stored. If
appearance_state is NULL, the annotation will have only one annotaion state.PDFNetException
public void flatten(Page page) throws PDFNetException
Note: an alternative approach to set the annotation as read only is using Annot.SetFlag(Annot::e_read_only, true) method. Unlike Annot.SetFlag(...), the result of Flatten() operation can not be programatically reversed.
page
- the pagePDFNetException
public java.lang.String getActiveAppearanceState() throws PDFNetException
PDFNetException
public void setActiveAppearanceState(java.lang.String astate) throws PDFNetException
astate
- a string representing the name of the new active appearance state.
The string used to select the annotation?s appearance state, which
selects the applicable appearance stream from an appearance subdictionary.PDFNetException
public ColorPt getColorAsRGB() throws PDFNetException
PDFNetException
public ColorPt getColorAsCMYK() throws PDFNetException
PDFNetException
public ColorPt getColorAsGray() throws PDFNetException
PDFNetException
public int getColorCompNum() throws PDFNetException
PDFNetException
public void setColor(ColorPt cpt, int comp_num) throws PDFNetException
cpt
- the cptcomp_num
- The color component number that indirectly implies the color space the color is from.PDFNetException
public int GetStructParent() throws PDFNetException
Note: The StructParent is the integer key of the annotation?s entry in the structural parent tree.
PDFNetException
public void setStructParent(int keyval) throws PDFNetException
Note: The StructParent is the integer key of the annotation?s entry in the structural parent tree.
keyval
- An integer which is the integer key of the
annotation?s entry in the structural parent tree.PDFNetException
public Obj getOptionalContent() throws PDFNetException
Note: The return value is an (optional content) group or (optional content) membership dictionary (PDF::OCG::OCMD)specifying the optional content properties for the annotation. Before the annotation is drawn, its visibility shall be determined based on this entry as well as the annotation flags specified in the Flag entry . If it is determined to be invisible, the annotation shall be skipped, as if it were not in the document.
PDFNetException
public void setOptionalContent(Obj oc) throws PDFNetException
oc
- An SDF object corresponding to the optional content,
a PDF::OCG::Group or membership dictionary specifying the PDF::OCG::Group properties for
the annotation. Before the annotation is drawn, its visibility
shall be determined based on this entry as well as the annotation
flags specified in the Flag entry . If it is determined to be invisible,
the annotation shall be skipped, as if it were not in the document.PDFNetException
public int getRotation() throws PDFNetException
Note: This property is part of the appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
PDFNetException
public void setRotation(int rot) throws PDFNetException
Note: This property is part of the appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
rot
- An integer representing the rotation value of the annotation.PDFNetException
public void refreshAppearance() throws PDFNetException
Note: If this annotation contains text, and has been added to a rotated page, the text in the annotation may be rotated. If RefreshAppearance is called *after* the annotation is added to a rotated page, then any text will be rotated in the opposite direction of the page rotation. If this method is called *before* the annotation is added to any rotated page, then no counter rotation will be applied. If you wish to call RefreshAppearance on an annotation already added to a rotated page, but you don't want the text to be rotated, you can do one of the following; temporarily un-rotate the page, or, temporarily remove the "Rotate" object from the annotation. To support users adding text annotations while using a PDF viewer, you can also add any viewer rotation to the annotations Rotate object, to have text always rotated correctly, from the users perspective.
PDFNetException
public void resize(Rect pos) throws PDFNetException
pos
- size to resize toPDFNetException
public static Annot __Create(long impl, java.lang.Object ref)
public long __GetHandle()
public java.lang.Object __GetRefHandle()