public abstract class PdfAnnotation extends PdfObjectWrapper<PdfDictionary>
Modifier and Type | Field and Description |
---|---|
static PdfString |
Accepted
Annotation state.
|
static PdfString |
Canceled
Annotation state.
|
static PdfString |
Completed
Annotation state.
|
static int |
HIDDEN
Annotation flag.
|
static PdfName |
HIGHLIGHT_INVERT
Widget annotation highlighting mode.
|
static PdfName |
HIGHLIGHT_NONE
Widget annotation highlighting mode.
|
static PdfName |
HIGHLIGHT_OUTLINE
Widget annotation highlighting mode.
|
static PdfName |
HIGHLIGHT_PUSH
Widget annotation highlighting mode.
|
static PdfName |
HIGHLIGHT_TOGGLE
Widget annotation highlighting mode.
|
static int |
INVISIBLE
Annotation flag.
|
static int |
LOCKED
Annotation flag.
|
static int |
LOCKED_CONTENTS
Annotation flag.
|
static PdfString |
Marked
Annotation state.
|
static PdfString |
MarkedModel
Annotation state model.
|
static int |
NO_ROTATE
Annotation flag.
|
static int |
NO_VIEW
Annotation flag.
|
static int |
NO_ZOOM
Annotation flag.
|
static PdfString |
None
Annotation state.
|
protected PdfPage |
page |
static int |
PRINT
Annotation flag.
|
static int |
READ_ONLY
Annotation flag.
|
static PdfString |
Rejected
Annotation state.
|
static PdfString |
ReviewModel
Annotation state model.
|
static PdfName |
STYLE_BEVELED
Annotation border style.
|
static PdfName |
STYLE_DASHED
Annotation border style.
|
static PdfName |
STYLE_INSET
Annotation border style.
|
static PdfName |
STYLE_SOLID
Annotation border style.
|
static PdfName |
STYLE_UNDERLINE
Annotation border style.
|
static int |
TOGGLE_NO_VIEW
Annotation flag.
|
static PdfString |
Unmarked
Annotation state.
|
Modifier | Constructor and Description |
---|---|
protected |
PdfAnnotation(PdfDictionary pdfObject) |
protected |
PdfAnnotation(Rectangle rect) |
Modifier and Type | Method and Description |
---|---|
void |
flush()
To manually flush a PdfObject behind this wrapper, you have to ensure that this object is added to the document, i.e.
|
PdfDictionary |
getAction()
An PdfAction to perform, such as launching an application, playing a sound, changing an annotation’s appearance state etc, when the annotation is activated.
|
PdfDictionary |
getAdditionalAction()
An additional actions dictionary that extends the set of events that can trigger the execution of an action.
|
PdfDictionary |
getAppearanceCharacteristics()
An appearance characteristics dictionary containing additional information for constructing the annotation’s appearance stream.
|
PdfDictionary |
getAppearanceDictionary()
An appearance dictionary specifying how the annotation shall be presented visually on the page during its interactions with the user (see ISO-320001 12.5.5, “Appearance Streams”).
|
PdfDictionary |
getAppearanceObject(PdfName appearanceType)
Specific appearance object corresponding to the specific appearance type.
|
PdfName |
getAppearanceState()
The annotation’s appearance state, which selects the applicable appearance stream from an appearance subdictionary if there is such.
|
PdfArray |
getBorder()
An array specifying the characteristics of the annotation’s border.
|
PdfDictionary |
getBorderStyle()
The dictionaries for some annotation types (such as free text and polygon annotations) can include the BS entry.
|
PdfArray |
getColorObject()
An array of numbers in the range 0.0 to 1.0, representing a 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 The number of array elements determines the colour space in which the colour shall be defined: 0 - No colour; transparent 1 - DeviceGray 3 - DeviceRGB 4 - DeviceCMYK
|
PdfString |
getContents()
Gets the text that shall be displayed for the annotation or, if this type of annotation does not display text, an alternate description of the annotation’s contents in human-readable form.
|
PdfString |
getDate()
The date and time when the annotation was most recently modified.
|
PdfDictionary |
getDownAppearanceObject()
The down appearance is used when the mouse button is pressed or held down within the annotation’s active area.
|
int |
getFlags()
A set of flags specifying various characteristics of the annotation (see ISO-320001 12.5.3, “Annotation Flags”).
|
PdfString |
getName()
Gets the annotation name, a text string uniquely identifying it among all the annotations on its page.
|
PdfDictionary |
getNormalAppearanceObject()
The normal appearance is used when the annotation is not interacting with the user.
|
boolean |
getOpen()
A flag specifying whether the annotation shall initially be displayed open.
|
PdfPage |
getPage()
Gets a PdfPage on which annotation is placed.
|
PdfDictionary |
getPageObject()
Gets a PdfDictionary that represents a page of the document on which annotation is placed, i.e.
|
PdfArray |
getQuadPoints()
An array of 8 × n numbers specifying the coordinates of n quadrilaterals in default user space.
|
PdfArray |
getRectangle()
The annotation rectangle, defining the location of the annotation on the page in default user space units.
|
PdfDictionary |
getRolloverAppearanceObject()
The rollover appearance is used when the user moves the cursor into the annotation’s active area without pressing the mouse button.
|
int |
getStructParentIndex()
The integer key of the annotation’s entry in the structural parent tree (see ISO-320001 14.7.4.4, “Finding Structure Elements from Content Items”).
|
abstract PdfName |
getSubtype()
Gets a PdfName which value is a subtype of this annotation.
|
PdfString |
getTitle()
Annotation title.
|
boolean |
hasFlag(int flag)
Checks if the certain flag that specifies a characteristic of the annotation is in enabled state (see ISO-320001 12.5.3, “Annotation Flags”).
|
protected boolean |
isWrappedObjectMustBeIndirect()
Defines if the object behind this wrapper must be an indirect object in the resultant document.
|
static PdfAnnotation |
makeAnnotation(PdfObject pdfObject)
Factory method that creates the type specific PdfAnnotation from the given PdfObject that represents annotation object.
|
static PdfAnnotation |
makeAnnotation(PdfObject pdfObject, PdfAnnotation parent)
Deprecated.
This method will be removed in iText 7.1. Please, simply use
makeAnnotation(PdfObject) .
|
PdfAnnotation |
put(PdfName key, PdfObject value)
Inserts the value into into the underlying PdfDictionary of this PdfAnnotation and associates it with the specified key.
|
PdfAnnotation |
remove(PdfName key)
Removes the specified key from the underlying PdfDictionary of this PdfAnnotation .
|
PdfAnnotation |
resetFlag(int flag)
Resets a flag that specifies a characteristic of the annotation to disabled state (see ISO-320001 12.5.3, “Annotation Flags”).
|
PdfAnnotation |
setAction(PdfAction action)
Sets a PdfAction to this annotation which will be performed when the annotation is activated.
|
PdfAnnotation |
setAdditionalAction(PdfName key, PdfAction action)
Sets an additional PdfAction to this annotation which will be performed in response to the specific trigger event defined by .
|
PdfAnnotation |
setAppearance(PdfName appearanceType, PdfAnnotationAppearance appearance)
Sets a specific type of the appearance using PdfAnnotationAppearance wrapper.
|
PdfAnnotation |
setAppearance(PdfName appearanceType, PdfDictionary appearance)
Sets a specific type of the appearance.
|
PdfAnnotation |
setAppearanceCharacteristics(PdfDictionary characteristics)
Sets an appearance characteristics dictionary containing additional information for constructing the annotation’s appearance stream.
|
PdfAnnotation |
setAppearanceState(PdfName as)
Sets the annotation’s appearance state, which selects the applicable appearance stream from an appearance subdictionary.
|
PdfAnnotation |
setBorder(PdfArray border)
Sets the characteristics of the annotation’s border.
|
PdfAnnotation |
setBorderStyle(PdfDictionary borderStyle)
Sets border style dictionary that has more settings than the array specified for the Border entry ( getBorder() ).
|
PdfAnnotation |
setBorderStyle(PdfName style)
Setter for the annotation's preset border style.
|
PdfAnnotation |
setColor(Color color)
Sets an annotation color.
|
PdfAnnotation |
setColor(float[] color)
Sets an annotation color.
|
PdfAnnotation |
setColor(PdfArray color)
Sets an annotation color.
|
PdfAnnotation |
setContents(PdfString contents)
Sets the text that shall be displayed for the annotation or, if this type of annotation does not display text, an alternate description of the annotation’s contents in human-readable form.
|
PdfAnnotation |
setContents(String contents)
Sets the text that shall be displayed for the annotation or, if this type of annotation does not display text, an alternate description of the annotation’s contents in human-readable form.
|
PdfAnnotation |
setDashPattern(PdfArray dashPattern)
Setter for the annotation's preset dashed border style.
|
PdfAnnotation |
setDate(PdfString date)
The date and time when the annotation was most recently modified.
|
PdfAnnotation |
setDownAppearance(PdfAnnotationAppearance appearance)
Sets down appearance using PdfAnnotationAppearance wrapper.
|
PdfAnnotation |
setDownAppearance(PdfDictionary appearance)
Sets down appearance.
|
PdfAnnotation |
setFlag(int flag)
Sets a flag that specifies a characteristic of the annotation to enabled state (see ISO-320001 12.5.3, “Annotation Flags”).
|
PdfAnnotation |
setFlags(int flags)
Sets a set of flags specifying various characteristics of the annotation (see ISO-320001 12.5.3, “Annotation Flags”).
|
void |
setLayer(IPdfOCG layer)
Sets the layer this annotation belongs to.
|
PdfAnnotation |
setName(PdfString name)
Sets the annotation name, a text string uniquely identifying it among all the annotations on its page.
|
PdfAnnotation |
setNormalAppearance(PdfAnnotationAppearance appearance)
Sets normal appearance using PdfAnnotationAppearance wrapper.
|
PdfAnnotation |
setNormalAppearance(PdfDictionary appearance)
Sets normal appearance.
|
PdfAnnotation |
setOpen(boolean open)
Sets a flag specifying whether the annotation shall initially be displayed open.
|
PdfAnnotation |
setPage(PdfPage page)
Method that modifies annotation page property, which defines to which page annotation belongs.
|
PdfAnnotation |
setQuadPoints(PdfArray quadPoints)
Sets n quadrilaterals in default user space by passing an PdfArray of 8 × n numbers.
|
PdfAnnotation |
setRectangle(PdfArray array)
The annotation rectangle, defining the location of the annotation on the page in default user space units.
|
PdfAnnotation |
setRolloverAppearance(PdfAnnotationAppearance appearance)
Sets rollover appearance using PdfAnnotationAppearance wrapper.
|
PdfAnnotation |
setRolloverAppearance(PdfDictionary appearance)
Sets rollover appearance.
|
PdfAnnotation |
setStructParentIndex(int structParentIndex)
Sets he integer key of the annotation’s entry in the structural parent tree (see ISO-320001 14.7.4.4, “Finding Structure Elements from Content Items”).
|
PdfAnnotation |
setTitle(PdfString title)
Sets annotation title.
|
ensureObjectIsAddedToDocument, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
public static final int INVISIBLE
setFlag(int)
and ISO-320001, table 165.
public static final int HIDDEN
setFlag(int)
and ISO-320001, table 165.
public static final int PRINT
setFlag(int)
and ISO-320001, table 165.
public static final int NO_ZOOM
setFlag(int)
and ISO-320001, table 165.
public static final int NO_ROTATE
setFlag(int)
and ISO-320001, table 165.
public static final int NO_VIEW
setFlag(int)
and ISO-320001, table 165.
public static final int READ_ONLY
setFlag(int)
and ISO-320001, table 165.
public static final int LOCKED
setFlag(int)
and ISO-320001, table 165.
public static final int TOGGLE_NO_VIEW
setFlag(int)
and ISO-320001, table 165.
public static final int LOCKED_CONTENTS
setFlag(int)
and ISO-320001, table 165.
public static final PdfName HIGHLIGHT_NONE
PdfWidgetAnnotation.setHighlightMode(PdfName)
.
public static final PdfName HIGHLIGHT_INVERT
PdfWidgetAnnotation.setHighlightMode(PdfName)
.
public static final PdfName HIGHLIGHT_OUTLINE
PdfWidgetAnnotation.setHighlightMode(PdfName)
.
public static final PdfName HIGHLIGHT_PUSH
PdfWidgetAnnotation.setHighlightMode(PdfName)
.
public static final PdfName HIGHLIGHT_TOGGLE
PdfWidgetAnnotation.setHighlightMode(PdfName)
.
public static final PdfName STYLE_SOLID
setBorderStyle(PdfName)
public static final PdfName STYLE_DASHED
setBorderStyle(PdfName)
public static final PdfName STYLE_BEVELED
setBorderStyle(PdfName)
public static final PdfName STYLE_INSET
setBorderStyle(PdfName)
public static final PdfName STYLE_UNDERLINE
setBorderStyle(PdfName)
public static final PdfString Marked
PdfTextAnnotation.setState(PdfString)
.
public static final PdfString Unmarked
PdfTextAnnotation.setState(PdfString)
.
public static final PdfString Accepted
PdfTextAnnotation.setState(PdfString)
.
public static final PdfString Rejected
PdfTextAnnotation.setState(PdfString)
.
public static final PdfString Canceled
PdfTextAnnotation.setState(PdfString)
.
public static final PdfString Completed
PdfTextAnnotation.setState(PdfString)
.
public static final PdfString None
PdfTextAnnotation.setState(PdfString)
.
public static final PdfString MarkedModel
PdfTextAnnotation.setStateModel(PdfString)
.
public static final PdfString ReviewModel
PdfTextAnnotation.setStateModel(PdfString)
.
protected PdfPage page
protected PdfAnnotation(Rectangle rect)
protected PdfAnnotation(PdfDictionary pdfObject)
public static PdfAnnotation makeAnnotation(PdfObject pdfObject)
PdfAnnotation
from the given PdfObject
that represents annotation object. This method is useful for property reading in reading mode or modifying in stamping mode. See derived classes of this class to see possible specific annotation types created.
pdfObject
- a PdfObject
that represents annotation in the document.
PdfAnnotation
.
@Deprecated public static PdfAnnotation makeAnnotation(PdfObject pdfObject, PdfAnnotation parent)
makeAnnotation(PdfObject)
.
PdfAnnotation
from the given PdfObject
that represents annotation object. This method is useful for property reading in reading mode or modifying in stamping mode.
pdfObject
- a PdfObject
that represents annotation in the document.
parent
- parent annotation of the PdfPopupAnnotation
to be created. This parameter is only needed if passed PdfObject
represents a pop-up annotation in the document.
PdfAnnotation
.
public abstract PdfName getSubtype()
PdfName
which value is a subtype of this annotation. See ISO-320001 12.5.6, “Annotation Types” for the reference to the possible types.
public void setLayer(IPdfOCG layer)
layer
- the layer this annotation belongs to
public PdfAnnotation setAction(PdfAction action)
PdfAction
to this annotation which will be performed when the annotation is activated.
action
- PdfAction
to set to this annotation.
PdfAnnotation
instance.
public PdfAnnotation setAdditionalAction(PdfName key, PdfAction action)
PdfAction
to this annotation which will be performed in response to the specific trigger event defined by . See ISO-320001 12.6.3, "Trigger Events".
key
- a PdfName
that denotes a type of the additional action to set.
action
- PdfAction
to set as additional to this annotation.
PdfAnnotation
instance.
public PdfString getContents()
public PdfAnnotation setContents(PdfString contents)
contents
- a PdfString
containing text content to be set to the annotation.
PdfAnnotation
instance.
public PdfAnnotation setContents(String contents)
contents
- a java String
containing text content to be set to the annotation.
PdfAnnotation
instance.
public PdfDictionary getPageObject()
PdfDictionary
that represents a page of the document on which annotation is placed, i.e. which has this annotation in it's /Annots array.
PdfDictionary
that is a page pdf object or null if annotation is not added to the page yet.
public PdfPage getPage()
PdfPage
on which annotation is placed.
PdfPage
on which annotation is placed or null if annotation is not placed yet.
public PdfAnnotation setPage(PdfPage page)
PdfPage.addAnnotation(PdfAnnotation)
. Also you don't need to set this property manually, this is done automatically on addition to the page.
page
- the PdfPage
to which annotation will be added.
PdfAnnotation
instance.
public PdfString getName()
PdfString
with annotation name as it's value or null if name is not specified.
public PdfAnnotation setName(PdfString name)
name
- a PdfString
to be set as annotation name.
PdfAnnotation
instance.
public PdfString getDate()
PdfString
with the modification date as it's value or null if date is not specified.
public PdfAnnotation setDate(PdfString date)
date
- a PdfString
with date. The format should be a date string as described in ISO-320001 7.9.4, “Dates”.
PdfAnnotation
instance.
public int getFlags()
setFlag(int)
. Default value: 0.
public PdfAnnotation setFlags(int flags)
setFlag(int)
, this method sets a complete set of enabled and disabled flags at once. If not set specifically the default value is 0.
flags
- an integer interpreted as set of one-bit flags specifying various characteristics of the annotation.
PdfAnnotation
instance.
public PdfAnnotation setFlag(int flag)
setFlags(int)
, this method sets only specified flags to enabled state, but doesn't disable other flags. Possible flags:
INVISIBLE
- If 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 unknown annotation using an appearance stream specified by its appearance dictionary, if any. HIDDEN
- If 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. PRINT
- If set, print the annotation when the page is printed. If clear, never print the annotation, regardless of whether it is displayed on the screen. NO_ZOOM
- If set, do not scale the annotation’s appearance to match the magnification of the page. The location of the annotation on the page (defined by the upper-left corner of its annotation rectangle) shall remain fixed, regardless of the page magnification.} NO_ROTATE
- If set, do not rotate the annotation’s appearance to match the rotation of the page. The upper-left corner of the annotation rectangle shall remain in a fixed location on the page, regardless of the page rotation. NO_VIEW
- If 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. READ_ONLY
- If 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. LOCKED
- If 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. TOGGLE_NO_VIEW
- If set, invert the interpretation of the NoView flag for certain events. LOCKED_CONTENTS
- If 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. flag
- - an integer interpreted as set of one-bit flags which will be enabled for this annotation.
PdfAnnotation
instance.
public PdfAnnotation resetFlag(int flag)
flag
- an integer interpreted as set of one-bit flags which will be reset to disabled state.
PdfAnnotation
instance.
public boolean hasFlag(int flag)
setFlag(int)
.
flag
- an integer interpreted as set of one-bit flags. Only one bit must be set in this integer, otherwise exception is thrown.
public PdfDictionary getAppearanceDictionary()
PdfDictionary
or null if it is not specified.
public PdfDictionary getAppearanceObject(PdfName appearanceType)
public PdfDictionary getNormalAppearanceObject()
getAppearanceObject(PdfName)
.
public PdfDictionary getRolloverAppearanceObject()
getAppearanceObject(PdfName)
.
public PdfDictionary getDownAppearanceObject()
getAppearanceObject(PdfName)
.
public PdfAnnotation setAppearance(PdfName appearanceType, PdfDictionary appearance)
getAppearanceObject(PdfName)
and getAppearanceDictionary()
for more info.
appearanceType
- a PdfName
specifying appearance type. Possible types are Normal
, Rollover
and Down
.
appearance
- an appearance object which might be either an appearance stream or an appearance subdictionary.
PdfAnnotation
instance.
public PdfAnnotation setNormalAppearance(PdfDictionary appearance)
getNormalAppearanceObject()
and getAppearanceDictionary()
for more info.
appearance
- an appearance object which might be either an appearance stream or an appearance subdictionary.
PdfAnnotation
instance.
public PdfAnnotation setRolloverAppearance(PdfDictionary appearance)
getRolloverAppearanceObject()
and getAppearanceDictionary()
for more info.
appearance
- an appearance object which might be either an appearance stream or an appearance subdictionary.
PdfAnnotation
instance.
public PdfAnnotation setDownAppearance(PdfDictionary appearance)
getDownAppearanceObject()
and getAppearanceDictionary()
for more info.
appearance
- an appearance object which might be either an appearance stream or an appearance subdictionary.
PdfAnnotation
instance.
public PdfAnnotation setAppearance(PdfName appearanceType, PdfAnnotationAppearance appearance)
PdfAnnotationAppearance
wrapper. This method is used to set only an appearance subdictionary. See getAppearanceObject(PdfName)
and getAppearanceDictionary()
for more info.
appearanceType
- a PdfName
specifying appearance type. Possible types are Normal
, Rollover
and Down
.
appearance
- an appearance subdictionary wrapped in PdfAnnotationAppearance
.
PdfAnnotation
instance.
public PdfAnnotation setNormalAppearance(PdfAnnotationAppearance appearance)
PdfAnnotationAppearance
wrapper. This method is used to set only appearance subdictionary. See getNormalAppearanceObject()
and getAppearanceDictionary()
for more info.
appearance
- an appearance subdictionary wrapped in PdfAnnotationAppearance
.
PdfAnnotation
instance.
public PdfAnnotation setRolloverAppearance(PdfAnnotationAppearance appearance)
PdfAnnotationAppearance
wrapper. This method is used to set only appearance subdictionary. See getRolloverAppearanceObject()
and getAppearanceDictionary()
for more info.
appearance
- an appearance subdictionary wrapped in PdfAnnotationAppearance
.
PdfAnnotation
instance.
public PdfAnnotation setDownAppearance(PdfAnnotationAppearance appearance)
PdfAnnotationAppearance
wrapper. This method is used to set only appearance subdictionary. See getDownAppearanceObject()
and getAppearanceDictionary()
for more info.
appearance
- an appearance subdictionary wrapped in PdfAnnotationAppearance
.
PdfAnnotation
instance.
public PdfName getAppearanceState()
getAppearanceObject(PdfName)
for more info.
PdfName
which defines selected appearance state.
public PdfAnnotation setAppearanceState(PdfName as)
getAppearanceObject(PdfName)
for more info.
as
- a PdfName
which defines appearance state to be selected.
PdfAnnotation
instance.
public PdfArray getBorder()
An array specifying the characteristics of the annotation’s border. The array consists of three numbers defining the horizontal corner radius, vertical corner radius, and border width, all in default user space units. If the corner radii are 0, the border has square (not rounded) corners; if the border width is 0, no border is drawn.
The array may have a fourth element, an optional dash array (see ISO-320001 8.4.3.6, “Line Dash Pattern”).
PdfArray
specifying the characteristics of the annotation’s border.
public PdfAnnotation setBorder(PdfArray border)
border
- an PdfArray
specifying the characteristics of the annotation’s border. See getBorder()
for more detailes.
PdfAnnotation
instance.
public PdfArray getColorObject()
public PdfAnnotation setColor(PdfArray color)
PdfArray
see getColorObject()
.
color
- an array of numbers in the range 0.0 to 1.0, specifying color.
PdfAnnotation
instance.
public PdfAnnotation setColor(float[] color)
getColorObject()
.
color
- an array of numbers in the range 0.0 to 1.0, specifying color.
PdfAnnotation
instance.
public PdfAnnotation setColor(Color color)
getColorObject()
.
color
- Color
object of the either DeviceGray
, DeviceRgb
or DeviceCmyk
type.
PdfAnnotation
instance.
public int getStructParentIndex()
public PdfAnnotation setStructParentIndex(int structParentIndex)
structParentIndex
- integer which is to be the key of the annotation's entry in structural parent tree.
PdfAnnotation
instance.
public boolean getOpen()
public PdfAnnotation setOpen(boolean open)
open
- true if annotation shall initially be open, false - if closed.
PdfAnnotation
instance.
public PdfArray getQuadPoints()
IMPORTANT NOTE: According to Table 179 in ISO 32000-1, the QuadPoints array lists the vertices in counterclockwise order and the text orientation is defined by the first and second vertex. This basically means QuadPoints is specified as lower-left, lower-right, top-right, top-left. HOWEVER, Adobe's interpretation (tested at least with Acrobat 10, Acrobat 11, Reader 11) is top-left, top-right, lower-left, lower-right (Z-shaped order). This means that if the QuadPoints array is specified according to the standard, the rendering is not as expected. Other viewers seem to follow Adobe's interpretation. Hence we recommend to use and expect QuadPoints array in Z-order, just as Acrobat and probably most other viewers expect.
PdfArray
of 8 × n numbers specifying the coordinates of n quadrilaterals.
public PdfAnnotation setQuadPoints(PdfArray quadPoints)
PdfArray
of 8 × n numbers. For more info of what quadrilaterals define see getQuadPoints()
.
IMPORTANT NOTE: According to Table 179 in ISO 32000-1, the QuadPoints array lists the vertices in counterclockwise order and the text orientation is defined by the first and second vertex. This basically means QuadPoints is specified as lower-left, lower-right, top-right, top-left. HOWEVER, Adobe's interpretation (tested at least with Acrobat 10, Acrobat 11, Reader 11) is top-left, top-right, lower-left, lower-right (Z-shaped order). This means that if the QuadPoints array is specified according to the standard, the rendering is not as expected. Other viewers seem to follow Adobe's interpretation. Hence we recommend to use and expect QuadPoints array in Z-order, just as Acrobat and probably most other viewers expect.
quadPoints
- an PdfArray
of 8 × n numbers specifying the coordinates of n quadrilaterals.
PdfAnnotation
instance.
public PdfAnnotation setBorderStyle(PdfDictionary borderStyle)
getBorder()
). See ISO-320001, Table 166 and getBorderStyle()
for more info.
borderStyle
- a border style dictionary specifying the line width and dash pattern that shall be used in drawing the annotation’s border.
PdfAnnotation
instance.
public PdfAnnotation setBorderStyle(PdfName style)
STYLE_SOLID
- A solid rectangle surrounding the annotation.STYLE_DASHED
- A dashed rectangle surrounding the annotation.STYLE_BEVELED
- A simulated embossed rectangle that appears to be raised above the surface of the page.STYLE_INSET
- A simulated engraved rectangle that appears to be recessed below the surface of the page.STYLE_UNDERLINE
- A single line along the bottom of the annotation rectangle.style
- The new value for the annotation's border style.
getBorderStyle()
public PdfAnnotation setDashPattern(PdfArray dashPattern)
STYLE_DASHED
style was used for the annotation border style (see setBorderStyle(PdfName)
. See ISO-320001 8.4.3.6, “Line Dash Pattern” for the format in which dash pattern shall be specified.
dashPattern
- a dash array defining a pattern of dashes and gaps that shall be used in drawing a dashed border.
PdfAnnotation
instance.
public PdfDictionary getBorderStyle()
getBorder()
). If an annotation dictionary includes the BS entry, then the Border entry is ignored. If annotation includes AP (see getAppearanceDictionary()
) it takes precedence over the BS entry. For more info on BS entry see ISO-320001, Table 166.
PdfDictionary
which is a border style dictionary or null if it is not specified.
public PdfAnnotation setTitle(PdfString title)
title
- a PdfString
which value is to be annotation title.
PdfAnnotation
instance.
public PdfString getTitle()
PdfString
which value is an annotation title or null if it isn't specifed.
public PdfAnnotation setAppearanceCharacteristics(PdfDictionary characteristics)
PdfWidgetAnnotation
and PdfScreenAnnotation
.
characteristics
- the PdfDictionary
with additional information for appearance stream.
PdfAnnotation
instance.
public PdfDictionary getAppearanceCharacteristics()
PdfWidgetAnnotation
and PdfScreenAnnotation
.
public PdfDictionary getAction()
PdfAction
to perform, such as launching an application, playing a sound, changing an annotation’s appearance state etc, when the annotation is activated.
PdfDictionary
which defines the characteristics and behaviour of an action.
public PdfDictionary getAdditionalAction()
PdfDictionary
.
getAction()
public PdfAnnotation setRectangle(PdfArray array)
array
- a PdfArray
which specifies a rectangle by two diagonally opposite corners. Typically, the array is of form [llx lly urx ury].
PdfAnnotation
instance.
public PdfArray getRectangle()
PdfArray
which specifies a rectangle by two diagonally opposite corners. Typically, the array is of form [llx lly urx ury].
public PdfAnnotation put(PdfName key, PdfObject value)
PdfDictionary
of this PdfAnnotation
and associates it with the specified key. If the key is already present in this PdfAnnotation
, this method will override the old value with the specified one.
key
- key to insert or to override
value
- the value to associate with the specified key
PdfAnnotation
instance.
public PdfAnnotation remove(PdfName key)
PdfDictionary
of this PdfAnnotation
.
key
- key to be removed
PdfAnnotation
instance.
public void flush()
PdfObject
behind this wrapper, you have to ensure that this object is added to the document, i.e. it has an indirect reference. Basically this means that before flushing you need to explicitly call PdfObjectWrapper.makeIndirect(PdfDocument)
. For example: wrapperInstance.makeIndirect(document).flush(); Note that not every wrapper require this, only those that have such warning in documentation.
flush
in class PdfObjectWrapper<PdfDictionary>
protected boolean isWrappedObjectMustBeIndirect()
PdfObjectWrapper
isWrappedObjectMustBeIndirect
in class PdfObjectWrapper<PdfDictionary>
Copyright © 1998–2016 iText Group NV. All rights reserved.