Class Annotation
- java.lang.Object
-
- com.gitlab.pdftk_java.com.lowagie.text.Annotation
-
- All Implemented Interfaces:
Element
,MarkupAttributes
public class Annotation extends java.lang.Object implements Element, MarkupAttributes
AnAnnotation
is a little note that can be added to a page on a document.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.HashMap
annotationAttributes
This is the title of theAnnotation
.protected int
annotationtype
This is the type of annotation.static java.lang.String
APPLICATION
This is a possible attribute.static java.lang.String
CONTENT
This is a possible attribute.static java.lang.String
DEFAULTDIR
This is a possible attribute.static java.lang.String
DESTINATION
This is a possible attribute.static java.lang.String
FILE
This is a possible attribute.static int
FILE_DEST
This is a possible annotation type.static int
FILE_PAGE
This is a possible annotation type.static int
LAUNCH
This is a possible annotation type.protected float
llx
This is the lower left x-valuestatic java.lang.String
LLX
This is a possible attribute.protected float
lly
This is the lower left y-valuestatic java.lang.String
LLY
This is a possible attribute.protected java.util.Properties
markupAttributes
Contains extra markupAttributesstatic java.lang.String
MIMETYPE
This is a possible attribute.static java.lang.String
NAMED
This is a possible attribute.static int
NAMED_DEST
This is a possible annotation type.static java.lang.String
OPERATION
This is a possible attribute.static java.lang.String
PAGE
This is a possible attribute.static java.lang.String
PARAMETERS
This is a possible attribute.static int
SCREEN
This is a possible annotation type.static int
TEXT
This is a possible annotation type.static java.lang.String
TITLE
This is a possible attribute.static java.lang.String
URL
This is a possible attribute.static int
URL_AS_STRING
This is a possible annotation type.static int
URL_NET
This is a possible annotation type.protected float
urx
This is the upper right x-valuestatic java.lang.String
URX
This is a possible attribute.protected float
ury
This is the upper right y-valuestatic java.lang.String
URY
This is a possible attribute.-
Fields inherited from interface com.gitlab.pdftk_java.com.lowagie.text.Element
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, GRAPHIC, HEADER, IMGRAW, IMGTEMPLATE, JPEG, KEYWORDS, LIST, LISTITEM, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Annotation(float llx, float lly, float urx, float ury)
Constructs anAnnotation
with a certain title and some text.Annotation(float llx, float lly, float urx, float ury, int named)
Constructs anAnnotation
.Annotation(float llx, float lly, float urx, float ury, java.lang.String url)
Constructs anAnnotation
.Annotation(float llx, float lly, float urx, float ury, java.lang.String file, int page)
Constructs anAnnotation
.Annotation(float llx, float lly, float urx, float ury, java.lang.String file, java.lang.String dest)
Constructs anAnnotation
.Annotation(float llx, float lly, float urx, float ury, java.lang.String moviePath, java.lang.String mimeType, boolean showOnDisplay)
Creates a Screen anotation to embed media clipsAnnotation(float llx, float lly, float urx, float ury, java.lang.String application, java.lang.String parameters, java.lang.String operation, java.lang.String defaultdir)
Constructs anAnnotation
.Annotation(float llx, float lly, float urx, float ury, java.net.URL url)
Constructs anAnnotation
.Annotation(Annotation an)
Annotation(java.lang.String title, java.lang.String text)
Constructs anAnnotation
with a certain title and some text.Annotation(java.lang.String title, java.lang.String text, float llx, float lly, float urx, float ury)
Constructs anAnnotation
with a certain title and some text.Annotation(java.util.Properties attributes)
Returns anAnnotation
that has been constructed taking in account the value of some attributes .
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
annotationType()
Returns the type of thisAnnotation
.java.util.HashMap
attributes()
Gets the content of thisAnnotation
.java.lang.String
content()
Gets the content of thisAnnotation
.java.util.ArrayList
getChunks()
Gets all the chunks in this element.java.lang.String
getMarkupAttribute(java.lang.String name)
Returns the value of the specified attribute.java.util.Set
getMarkupAttributeNames()
Returns aSet
ofString
attribute names for theMarkupAttributes
implementor.java.util.Properties
getMarkupAttributes()
Return aProperties
-object containing all the markupAttributes.static boolean
isTag(java.lang.String tag)
Checks if a given tag corresponds with this object.float
llx()
Returns the lower left x-value.float
llx(float def)
Returns the lower left x-value.float
lly()
Returns the lower left y-value.float
lly(float def)
Returns the lower left y-value.boolean
process(ElementListener listener)
Processes the element by adding it (or the different parts) to anElementListener
.void
setDimensions(float llx, float lly, float urx, float ury)
Sets the dimensions of this annotation.void
setMarkupAttribute(java.lang.String name, java.lang.String value)
Sets the specified attribute.void
setMarkupAttributes(java.util.Properties markupAttributes)
Sets the markupAttributes.java.lang.String
title()
Returns the title of thisAnnotation
.int
type()
Gets the type of the text element.float
urx()
Returns the uppper right x-value.float
urx(float def)
Returns the upper right x-value.float
ury()
Returns the uppper right y-value.float
ury(float def)
Returns the upper right y-value.
-
-
-
Field Detail
-
TEXT
public static final int TEXT
This is a possible annotation type.- See Also:
- Constant Field Values
-
URL_NET
public static final int URL_NET
This is a possible annotation type.- See Also:
- Constant Field Values
-
URL_AS_STRING
public static final int URL_AS_STRING
This is a possible annotation type.- See Also:
- Constant Field Values
-
FILE_DEST
public static final int FILE_DEST
This is a possible annotation type.- See Also:
- Constant Field Values
-
FILE_PAGE
public static final int FILE_PAGE
This is a possible annotation type.- See Also:
- Constant Field Values
-
NAMED_DEST
public static final int NAMED_DEST
This is a possible annotation type.- See Also:
- Constant Field Values
-
LAUNCH
public static final int LAUNCH
This is a possible annotation type.- See Also:
- Constant Field Values
-
SCREEN
public static final int SCREEN
This is a possible annotation type.- See Also:
- Constant Field Values
-
TITLE
public static java.lang.String TITLE
This is a possible attribute.
-
CONTENT
public static java.lang.String CONTENT
This is a possible attribute.
-
URL
public static java.lang.String URL
This is a possible attribute.
-
FILE
public static java.lang.String FILE
This is a possible attribute.
-
DESTINATION
public static java.lang.String DESTINATION
This is a possible attribute.
-
PAGE
public static java.lang.String PAGE
This is a possible attribute.
-
NAMED
public static java.lang.String NAMED
This is a possible attribute.
-
APPLICATION
public static java.lang.String APPLICATION
This is a possible attribute.
-
PARAMETERS
public static java.lang.String PARAMETERS
This is a possible attribute.
-
OPERATION
public static java.lang.String OPERATION
This is a possible attribute.
-
DEFAULTDIR
public static java.lang.String DEFAULTDIR
This is a possible attribute.
-
LLX
public static java.lang.String LLX
This is a possible attribute.
-
LLY
public static java.lang.String LLY
This is a possible attribute.
-
URX
public static java.lang.String URX
This is a possible attribute.
-
URY
public static java.lang.String URY
This is a possible attribute.
-
MIMETYPE
public static java.lang.String MIMETYPE
This is a possible attribute.
-
annotationtype
protected int annotationtype
This is the type of annotation.
-
annotationAttributes
protected java.util.HashMap annotationAttributes
This is the title of theAnnotation
.
-
markupAttributes
protected java.util.Properties markupAttributes
Contains extra markupAttributes
-
llx
protected float llx
This is the lower left x-value
-
lly
protected float lly
This is the lower left y-value
-
urx
protected float urx
This is the upper right x-value
-
ury
protected float ury
This is the upper right y-value
-
-
Constructor Detail
-
Annotation
private Annotation(float llx, float lly, float urx, float ury)
Constructs anAnnotation
with a certain title and some text.- Parameters:
llx
- lower left x coordinatelly
- lower left y coordinateurx
- upper right x coordinateury
- upper right y coordinate
-
Annotation
public Annotation(Annotation an)
-
Annotation
public Annotation(java.lang.String title, java.lang.String text)
Constructs anAnnotation
with a certain title and some text.- Parameters:
title
- the title of the annotationtext
- the content of the annotation
-
Annotation
public Annotation(java.lang.String title, java.lang.String text, float llx, float lly, float urx, float ury)
Constructs anAnnotation
with a certain title and some text.- Parameters:
title
- the title of the annotationtext
- the content of the annotationllx
- the lower left x-valuelly
- the lower left y-valueurx
- the upper right x-valueury
- the upper right y-value
-
Annotation
public Annotation(float llx, float lly, float urx, float ury, java.net.URL url)
Constructs anAnnotation
.- Parameters:
llx
- the lower left x-valuelly
- the lower left y-valueurx
- the upper right x-valueury
- the upper right y-valueurl
- the external reference
-
Annotation
public Annotation(float llx, float lly, float urx, float ury, java.lang.String url)
Constructs anAnnotation
.- Parameters:
llx
- the lower left x-valuelly
- the lower left y-valueurx
- the upper right x-valueury
- the upper right y-valueurl
- the external reference
-
Annotation
public Annotation(float llx, float lly, float urx, float ury, java.lang.String file, java.lang.String dest)
Constructs anAnnotation
.- Parameters:
llx
- the lower left x-valuelly
- the lower left y-valueurx
- the upper right x-valueury
- the upper right y-valuefile
- an external PDF filedest
- the destination in this file
-
Annotation
public Annotation(float llx, float lly, float urx, float ury, java.lang.String moviePath, java.lang.String mimeType, boolean showOnDisplay)
Creates a Screen anotation to embed media clips- Parameters:
llx
-lly
-urx
-ury
-moviePath
- path to the media clip filemimeType
- mime type of the mediashowOnDisplay
- if true play on display of the page
-
Annotation
public Annotation(float llx, float lly, float urx, float ury, java.lang.String file, int page)
Constructs anAnnotation
.- Parameters:
llx
- the lower left x-valuelly
- the lower left y-valueurx
- the upper right x-valueury
- the upper right y-valuefile
- an external PDF filepage
- a page number in this file
-
Annotation
public Annotation(float llx, float lly, float urx, float ury, int named)
Constructs anAnnotation
.- Parameters:
llx
- the lower left x-valuelly
- the lower left y-valueurx
- the upper right x-valueury
- the upper right y-valuenamed
- a named destination in this file
-
Annotation
public Annotation(float llx, float lly, float urx, float ury, java.lang.String application, java.lang.String parameters, java.lang.String operation, java.lang.String defaultdir)
Constructs anAnnotation
.- Parameters:
llx
- the lower left x-valuelly
- the lower left y-valueurx
- the upper right x-valueury
- the upper right y-valueapplication
- an external applicationparameters
- parameters to pass to this applicationoperation
- the operation to pass to this applicationdefaultdir
- the default directory to run this application in
-
Annotation
public Annotation(java.util.Properties attributes)
Returns anAnnotation
that has been constructed taking in account the value of some attributes .- Parameters:
attributes
- Some attributes
-
-
Method Detail
-
type
public int type()
Gets the type of the text element.
-
process
public boolean process(ElementListener listener)
Processes the element by adding it (or the different parts) to anElementListener
.
-
getChunks
public java.util.ArrayList getChunks()
Gets all the chunks in this element.
-
setDimensions
public void setDimensions(float llx, float lly, float urx, float ury)
Sets the dimensions of this annotation.- Parameters:
llx
- the lower left x-valuelly
- the lower left y-valueurx
- the upper right x-valueury
- the upper right y-value
-
llx
public float llx()
Returns the lower left x-value.- Returns:
- a value
-
lly
public float lly()
Returns the lower left y-value.- Returns:
- a value
-
urx
public float urx()
Returns the uppper right x-value.- Returns:
- a value
-
ury
public float ury()
Returns the uppper right y-value.- Returns:
- a value
-
llx
public float llx(float def)
Returns the lower left x-value.- Parameters:
def
- the default value- Returns:
- a value
-
lly
public float lly(float def)
Returns the lower left y-value.- Parameters:
def
- the default value- Returns:
- a value
-
urx
public float urx(float def)
Returns the upper right x-value.- Parameters:
def
- the default value- Returns:
- a value
-
ury
public float ury(float def)
Returns the upper right y-value.- Parameters:
def
- the default value- Returns:
- a value
-
annotationType
public int annotationType()
Returns the type of thisAnnotation
.- Returns:
- a type
-
title
public java.lang.String title()
Returns the title of thisAnnotation
.- Returns:
- a name
-
content
public java.lang.String content()
Gets the content of thisAnnotation
.- Returns:
- a reference
-
attributes
public java.util.HashMap attributes()
Gets the content of thisAnnotation
.- Returns:
- a reference
-
isTag
public static boolean isTag(java.lang.String tag)
Checks if a given tag corresponds with this object.- Parameters:
tag
- the given tag- Returns:
- true if the tag corresponds
-
setMarkupAttribute
public void setMarkupAttribute(java.lang.String name, java.lang.String value)
Description copied from interface:MarkupAttributes
Sets the specified attribute.- Specified by:
setMarkupAttribute
in interfaceMarkupAttributes
- Parameters:
name
-String
attribute name.value
-String
attribute value.- See Also:
MarkupAttributes.setMarkupAttribute(java.lang.String, java.lang.String)
-
setMarkupAttributes
public void setMarkupAttributes(java.util.Properties markupAttributes)
Description copied from interface:MarkupAttributes
Sets the markupAttributes.- Specified by:
setMarkupAttributes
in interfaceMarkupAttributes
- Parameters:
markupAttributes
- aProperties
-object containing markupattributes- See Also:
MarkupAttributes.setMarkupAttributes(java.util.Properties)
-
getMarkupAttribute
public java.lang.String getMarkupAttribute(java.lang.String name)
Description copied from interface:MarkupAttributes
Returns the value of the specified attribute.- Specified by:
getMarkupAttribute
in interfaceMarkupAttributes
- Parameters:
name
-String
attribute name.- Returns:
String
.- See Also:
MarkupAttributes.getMarkupAttribute(java.lang.String)
-
getMarkupAttributeNames
public java.util.Set getMarkupAttributeNames()
Description copied from interface:MarkupAttributes
Returns aSet
ofString
attribute names for theMarkupAttributes
implementor.- Specified by:
getMarkupAttributeNames
in interfaceMarkupAttributes
- Returns:
Set
.- See Also:
MarkupAttributes.getMarkupAttributeNames()
-
getMarkupAttributes
public java.util.Properties getMarkupAttributes()
Description copied from interface:MarkupAttributes
Return aProperties
-object containing all the markupAttributes.- Specified by:
getMarkupAttributes
in interfaceMarkupAttributes
- Returns:
Properties
- See Also:
MarkupAttributes.getMarkupAttributes()
-
-