pdftron.PDF
Class Annot

java.lang.Object
  extended by pdftron.PDF.Annot
Direct Known Subclasses:
Link, Markup, Movie, Popup, Screen, Watermark, Widget

public class Annot
extends java.lang.Object

Annot is a base class for different types of annotations. For annotation specific properties, please refer to derived classes. An annotation is an interactive object placed on a page, such as a text note, a link, or an embedded file. PDF includes a wide variety of standard annotation types. An annotation associates an object such as a widget, note, or movie with a location on a page of a PDF document, or provides a means of interacting with the user via the mouse and keyboard. For more details on PDF annotations please refer to section 12.5 in the PDF Reference Manual and the


Nested Class Summary
static class Annot.BorderStyle
          BorderStyle structure specifies the characteristics of the annotation’s border.
 
Field Summary
static int e_3D
          The Constant e_3D.
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 Summary
Annot()
          Create an empty annotation.
Annot(Obj d)
          Create an annotation and initialize it using given Cos/SDF object.
 
Method Summary
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()
          Get annotation's 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
 Obj getSDFObj()
          Get the SDFObj.
 int GetStructParent()
          Get the struct parent of an annotation.
 int getType()
          Get the annotation type.
 Obj getUniqueID()
          Get the annotiation unique ID.
 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)
          Set an annotation's 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 setStructParent(int keyval)
          Set the struct parent of an annotation.
 void setUniqueID(java.lang.String icon_name)
          Set the unique identifier for this annotation.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

e_Text

public static final int e_Text
PDF supports the standard annotation types listed in the following enumeration (plug-in extensions may add new annotation types):.

See Also:
Constant Field Values

e_Link

public static final int e_Link
The Constant e_Link.

See Also:
Constant Field Values

e_FreeText

public static final int e_FreeText
The Constant e_FreeText.

See Also:
Constant Field Values

e_Line

public static final int e_Line
The Constant e_Line.

See Also:
Constant Field Values

e_Square

public static final int e_Square
The Constant e_Square.

See Also:
Constant Field Values

e_Circle

public static final int e_Circle
The Constant e_Circle.

See Also:
Constant Field Values

e_Polygon

public static final int e_Polygon
The Constant e_Polygon.

See Also:
Constant Field Values

e_Polyline

public static final int e_Polyline
The Constant e_Polyline.

See Also:
Constant Field Values

e_Highlight

public static final int e_Highlight
The Constant e_Highlight.

See Also:
Constant Field Values

e_Underline

public static final int e_Underline
The Constant e_Underline.

See Also:
Constant Field Values

e_Squiggly

public static final int e_Squiggly
The Constant e_Squiggly.

See Also:
Constant Field Values

e_StrikeOut

public static final int e_StrikeOut
The Constant e_StrikeOut.

See Also:
Constant Field Values

e_Stamp

public static final int e_Stamp
The Constant e_Stamp.

See Also:
Constant Field Values

e_Caret

public static final int e_Caret
The Constant e_Caret.

See Also:
Constant Field Values

e_Ink

public static final int e_Ink
The Constant e_Ink.

See Also:
Constant Field Values

e_Popup

public static final int e_Popup
The Constant e_Popup.

See Also:
Constant Field Values

e_FileAttachment

public static final int e_FileAttachment
The Constant e_FileAttachment.

See Also:
Constant Field Values

e_Sound

public static final int e_Sound
The Constant e_Sound.

See Also:
Constant Field Values

e_Movie

public static final int e_Movie
The Constant e_Movie.

See Also:
Constant Field Values

e_Widget

public static final int e_Widget
The Constant e_Widget.

See Also:
Constant Field Values

e_Screen

public static final int e_Screen
The Constant e_Screen.

See Also:
Constant Field Values

e_PrinterMark

public static final int e_PrinterMark
The Constant e_PrinterMark.

See Also:
Constant Field Values

e_TrapNet

public static final int e_TrapNet
The Constant e_TrapNet.

See Also:
Constant Field Values

e_Watermark

public static final int e_Watermark
The Constant e_Watermark.

See Also:
Constant Field Values

e_3D

public static final int e_3D
The Constant e_3D.

See Also:
Constant Field Values

e_Redact

public static final int e_Redact
The Constant e_Redact.

See Also:
Constant Field Values

e_Projection

public static final int e_Projection
The Constant e_Projection.

See Also:
Constant Field Values

e_RichMedia

public static final int e_RichMedia
The Constant e_RichMedia.

See Also:
Constant Field Values

e_Unknown

public static final int e_Unknown
The Constant e_Unknown.

See Also:
Constant Field Values

e_invisible

public static final int e_invisible
Flags specifying various characteristics of the annotation. - If e_invisible is set, do not display the annotation if it does not belong to one of the standard annotation types and no annotation handler is available. If clear, display such an unknown annotation using an appearance stream specified by its appearance dictionary, if any. - If e_hidden is set, do not display or print the annotation or allow it to interact with the user, regardless of its annotation type or whether an annotation handler is available. - If e_print is set, print the annotation when the page is printed. If clear, never print the annotation, regardless of whether it is displayed on the screen. This can be useful, for example, for annotations representing interactive pushbuttons, which would serve no meaningful purpose on the printed page. - If e_no_zoom is set, do not scale the annotation’s appearance to match the magnification of the page. - If e_no_rotate is set, do not rotate the annotation’s appearance to match the rotation of the page. - If e_no_view is set, do not display the annotation on the screen or allow it to interact with the user. The annotation may be printed (depending on the setting of the Print flag) but should be considered hidden for purposes of on-screen display and user interaction. - If e_read_only is set, do not allow the annotation to interact with the user. The annotation may be displayed or printed (depending on the settings of the NoView and Print flags) but should not respond to mouse clicks or change its appearance in response to mouse motions. - If e_locked is set, do not allow the annotation to be deleted or its properties (including position and size) to be modified by the user. However, this flag does not restrict changes to the annotation’s contents, such as the value of a form field. - If e_toggle_no_view is set, invert the interpretation of the NoView flag for certain events. A typical use is to have an annotation that appears only when a mouse cursor is held over it. - If e_locked_contents is set, do not allow the contents of the annotation to be modified by the user. This flag does not restrict deletion of the annotation or changes to other annotation properties, such as position and size.

See Also:
Constant Field Values

e_hidden

public static final int e_hidden
The Constant e_hidden.

See Also:
Constant Field Values

e_print

public static final int e_print
The Constant e_print.

See Also:
Constant Field Values

e_no_zoom

public static final int e_no_zoom
The Constant e_no_zoom.

See Also:
Constant Field Values

e_no_rotate

public static final int e_no_rotate
The Constant e_no_rotate.

See Also:
Constant Field Values

e_no_view

public static final int e_no_view
The Constant e_no_view.

See Also:
Constant Field Values

e_read_only

public static final int e_read_only
The Constant e_read_only.

See Also:
Constant Field Values

e_locked

public static final int e_locked
The Constant e_locked.

See Also:
Constant Field Values

e_toggle_no_view

public static final int e_toggle_no_view
The Constant e_toggle_no_view.

See Also:
Constant Field Values

e_locked_contents

public static final int e_locked_contents
The Constant e_locked_contents.

See Also:
Constant Field Values

e_normal

public static final 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. This appearance is also used for printing the annotation. The rollover appearance is used when the user moves the cursor into the annotation’s active area without pressing the mouse button. The down appearance is used when the mouse button is pressed or held down within the annotation’s active area.

See Also:
Constant Field Values

e_rollover

public static final int e_rollover
The Constant e_rollover.

See Also:
Constant Field Values

e_down

public static final int e_down
The Constant e_down.

See Also:
Constant Field Values
Constructor Detail

Annot

public Annot(Obj d)
Create an annotation and initialize it using given Cos/SDF object.

Parameters:
d - the d
Note:
The constructor does not copy any data, but is instead the logical equivalent of a type cast.

Annot

public Annot()
Create an empty annotation.

Method Detail

create

public static Annot create(Doc doc,
                           int type,
                           Rect pos)
                    throws PDFNetException
Creates a new annotation of a given type, in the specified document. Because the newly created annotation does not contain any properties specific to a given annotation type, it is faster to create an annotation using type specific Annot.Create method.

Parameters:
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.
Returns:
A newly created blank annotation for the given annotation type.
Throws:
PDFNetException

equals

public boolean equals(java.lang.Object d)
Compares two annotations for equality. The comparison will return true only if both annotations share the same underlying SDF/Cos object.

Overrides:
equals in class java.lang.Object
Parameters:
d - the other annotation
Returns:
true, if successful

isValid

public boolean isValid()
                throws PDFNetException
Checks if Annot is valid.

Returns:
True if this is a valid (non-null) annotation, false otherwise. If the function returns false the underlying SDF/Cos object is null or is not valid and the annotation object should be treated as a null object.
Throws:
PDFNetException

getSDFObj

public Obj getSDFObj()
              throws PDFNetException
Get the SDFObj.

Returns:
The underlying SDF/Cos object.
Throws:
PDFNetException

getType

public int getType()
            throws PDFNetException
Get the annotation type.

Returns:
The type of this annotation.
Throws:
PDFNetException

isMarkup

public boolean isMarkup()
                 throws PDFNetException
Checks if annoation is markup.

Returns:
true, if is markup
Throws:
PDFNetException

getContents

public java.lang.String getContents()
                             throws PDFNetException
Get the annotation contents.

Returns:
contents from annotation
Throws:
PDFNetException

setContents

public void setContents(java.lang.String ct)
                 throws PDFNetException
Set annotation contents.

Parameters:
ct - the new contents
Throws:
PDFNetException

getRect

public Rect getRect()
             throws PDFNetException
Get annoation bound rectangle

Returns:
Annotation’s bounding rectangle, specified in user space coordinates. The meaning of the rectangle depends on the annotation type. For Link and RubberStamp annotations, the rectangle specifies the area containing the hyperlink area or stamp. For Note annotations, the rectangle is describing the popup window when it's opened. When it's closed, the icon is positioned at lower left corner.
Throws:
PDFNetException

setRect

public void setRect(Rect pos)
             throws PDFNetException
Set the size and location of an annotation on its page.

Parameters:
pos - the new bound rectangle
Throws:
PDFNetException

getPage

public Page getPage()
             throws PDFNetException
Get the page the annotation is associated with.

Returns:
A Page object or NULL if the page reference is not available. The page object returned is 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. Optional. PDF 1.3 PDF 1.4 PDF 1.5 not used in FDF files.
Throws:
PDFNetException

setPage

public void setPage(Page page)
             throws PDFNetException
Set the reference to a page the annotation is associated with. (Optional PDF 1.3; not used in FDF files)

Parameters:
page - the new 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

getUniqueID

public Obj getUniqueID()
                throws PDFNetException
Get the annotiation unique ID.

Returns:
The unique identifier for this annotation, or NULL if the identifier is not available. The returned value is a String object and is the value of the "NM" field, which was added as an optional attribute in PDF 1.4.
Throws:
PDFNetException

setUniqueID

public void setUniqueID(java.lang.String icon_name)
                 throws PDFNetException
Set the unique identifier for this annotation.

Parameters:
icon_name - the new unique id
Throws:
PDFNetException
Note:
It is necessary to ensure that the unique ID generated is actually unique.

getDate

public Date getDate()
             throws PDFNetException
Get annotation's date.

Returns:
The annotation's time and date. If the annotation has no associated date structure, the returned date is not valid (date.IsValid() returns false).
Throws:
PDFNetException

setDate

public void setDate(Date date)
             throws PDFNetException
Set an annotation's date.

Parameters:
date - the new date
Throws:
PDFNetException

getFlag

public boolean getFlag(int flag)
                throws PDFNetException
Determine if the give flag is marked flagged

Parameters:
flag - The Flag property to query.
Returns:
The value of given Flag
Throws:
PDFNetException

setFlag

public void setFlag(int flag,
                    boolean value)
             throws PDFNetException
Set the value of given Flag.

Parameters:
flag - The Flag property to modify.
value - The new value for the property.
Throws:
PDFNetException

getBorderStyle

public Annot.BorderStyle getBorderStyle()
                                 throws PDFNetException
Get the border style for the annotation. Typically used for Link annotations.

Returns:
Annotation's border style.
Throws:
PDFNetException

setBorderStyle

public void setBorderStyle(Annot.BorderStyle bs)
                    throws PDFNetException
Set the border style for the annotation. Typically used for Link annotations.

Parameters:
bs - New border style for this annotation.
Throws:
PDFNetException

getAppearance

public Obj getAppearance()
                  throws PDFNetException
Get the annotation’s appearance for the given combination of annotation and appearance states.

Returns:
The appearance stream for this annotation, or NULL if the annotation does not have an appearance for the given combination of annotation and appearance states.
Throws:
PDFNetException

getAppearance

public Obj getAppearance(int annot_state)
                  throws PDFNetException
Get the annotation’s appearance for the given combination of annotation and appearance states.

Parameters:
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.
Returns:
the appearance
Throws:
PDFNetException

getAppearance

public Obj getAppearance(int annot_state,
                         java.lang.String app_state)
                  throws PDFNetException
Get the annotation’s appearance for the given combination of annotation and appearance states.

Parameters:
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.
Returns:
The appearance stream for this annotation, or NULL if the annotation does not have an appearance for the given combination of annotation and appearance states.
Throws:
PDFNetException

setAppearance

public void setAppearance(Obj app_stream)
                   throws PDFNetException
Set the annotation’s appearance for the given combination of annotation and appearance states. (Optional; PDF 1.2)

Parameters:
app_stream - a content stream defining the new appearance.
Throws:
PDFNetException

removeAppearance

public void removeAppearance(int annot_state,
                             java.lang.String app_state)
                      throws PDFNetException
Removes the annotation's appearance for the given combination of annotation and appearance states.

Parameters:
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.
Throws:
PDFNetException

setAppearance

public void setAppearance(Obj app_stream,
                          int annot_state)
                   throws PDFNetException
Set the annotation’s appearance for the given combination of annotation and appearance states. (Optional; PDF 1.2)

Parameters:
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.
Throws:
PDFNetException

setAppearance

public void setAppearance(Obj app_stream,
                          int annot_state,
                          java.lang.String app_state)
                   throws PDFNetException
Set the annotation’s appearance for the given combination of annotation and appearance states. (Optional; PDF 1.2)

Parameters:
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.
Throws:
PDFNetException

flatten

public void flatten(Page page)
             throws PDFNetException
Flatten/Merge the existing annotation appearances with the page content and delete this annotation from a given page. Annotation 'flattening' refers to the operation that changes active annotations (such as markup, widgets, 3D models, etc.) into a static area that is part of the PDF document, just like the other text and images in the document.

Parameters:
page - the 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.

getActiveAppearanceState

public java.lang.String getActiveAppearanceState()
                                          throws PDFNetException
Get the annotation’s active appearance state.

Returns:
the name of the active state. The annotation’s appearance state, which selects the applicable appearance stream from an appearance subdictionary.
Throws:
PDFNetException

setActiveAppearanceState

public void setActiveAppearanceState(java.lang.String astate)
                              throws PDFNetException
Set the annotation’s active appearance state. (Required if the appearance dictionary AP contains one or more subdictionaries; PDF 1.2)

Parameters:
astate - the new active appearance state
Throws:
PDFNetException

getColorAsRGB

public ColorPt getColorAsRGB()
                      throws PDFNetException
Get an annotation's color.

Returns:
A ColorPt object containing an array of three numbers in the range 0.0 to 1.0, representing an RGB colour used for the following purposes: The background of the annotation’s icon when closed The title bar of the annotation’s pop-up window The border of a link annotation If the annotation does not specify an explicit color, a default color is returned. Text annotations return 'default yellow;' all others return black.
Throws:
PDFNetException

getColorAsCMYK

public ColorPt getColorAsCMYK()
                       throws PDFNetException
Get an annotation's color.

Returns:
A ColorPt object containing an array of four numbers in the range 0.0 to 1.0, representing a CMYK colour used for the following purposes: The background of the annotation’s icon when closed The title bar of the annotation’s pop-up window The border of a link annotation If the annotation does not specify an explicit color, a default color is returned. Text annotations return 'default yellow;' all others return black.
Throws:
PDFNetException

getColorAsGray

public ColorPt getColorAsGray()
                       throws PDFNetException
Get an annotation's color.

Returns:
A ColorPt object containing a number in the range 0.0 to 1.0, representing a Gray Scale colour used for the following purposes: The background of the annotation’s icon when closed The title bar of the annotation’s pop-up window The border of a link annotation If the annotation does not specify an explicit color, a default color is returned. Text annotations return 'default yellow;' all others return black.
Throws:
PDFNetException

getColorCompNum

public int getColorCompNum()
                    throws PDFNetException
Get the color space the annotation's color is represented in.

Returns:
An integer that is either 1(for DeviceGray), 3(DeviceRGB), or 4(DeviceCMYK). If the annotation has no color, i.e. is transparent, 0 will be returned.
Throws:
PDFNetException

setColor

public void setColor(ColorPt cpt,
                     int comp_num)
              throws PDFNetException
Set an annotation's color. (Optional; PDF 1.1)

Parameters:
cpt - the cpt
comp_num - The color component number that indirectly implies the color space the color is from.
Throws:
PDFNetException

GetStructParent

public int GetStructParent()
                    throws PDFNetException
Get the struct parent of an annotation. (Required if the annotation is a structural content item; PDF 1.3)

Returns:
An integer which is the integer key of the annotation’s entry in the structural parent tree.
Throws:
PDFNetException
Note:
The StructParent is the integer key of the annotation’s entry in the structural parent tree.

setStructParent

public void setStructParent(int keyval)
                     throws PDFNetException
Set the struct parent of an annotation. (Required if the annotation is a structural content item; PDF 1.3)

Parameters:
keyval - An integer which is the integer key of the annotation’s entry in the structural parent tree.
Throws:
PDFNetException
Note:
The StructParent is the integer key of the annotation’s entry in the structural parent tree.

getOptionalContent

public Obj getOptionalContent()
                       throws PDFNetException
Get optional content of an annotation.

Returns:
An SDF object corresponding to the grup of optional properties.
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.

setOptionalContent

public void setOptionalContent(Obj oc)
                        throws PDFNetException
Set optional content of an annotation. (Optional, PDF1.5).

Parameters:
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.
Throws:
PDFNetException

refreshAppearance

public void refreshAppearance()
                       throws PDFNetException
Regenerates the appearance stream for the annotation. This method can be used to auto-generate the annotation appearance after creating or modifying the annotation without providing an explicit appearance or setting the "NeedAppearances" flag in the AcroForm dictionary.

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 "P" object from the annotation.

resize

public void resize(Rect pos)
            throws PDFNetException
Resize annotation

Parameters:
pos - size to resize to
Throws:
PDFNetException

__Create

public static Annot __Create(long impl,
                             java.lang.Object ref)

__GetHandle

public long __GetHandle()

__GetRefHandle

public java.lang.Object __GetRefHandle()


© 2002-2011 PDFTron Systems Inc.