Class PdfAnnotation
java.lang.Object
com.aowagie.text.pdf.PdfObject
com.aowagie.text.pdf.PdfDictionary
com.aowagie.text.pdf.PdfAnnotation
- Direct Known Subclasses:
PdfFormField
A
PdfAnnotation is a note that is associated with a page.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanstatic final intflagvalueprotected booleanprotected HashMapprotected booleanHolds value of property used.protected PdfWriterFields inherited from class PdfDictionary
hashMap -
Constructor Summary
ConstructorsConstructorDescriptionPdfAnnotation(PdfWriter writer, float llx, float lly, float urx, float ury, PdfAction action) Constructs a newPdfAnnotationof subtype link (Action).PdfAnnotation(PdfWriter writer, float llx, float lly, float urx, float ury, PdfString title, PdfString content) Constructs a newPdfAnnotationof subtype text. -
Method Summary
Modifier and TypeMethodDescriptionstatic PdfAnnotationcreateScreen(PdfWriter writer, Rectangle rect, String clipTitle, PdfFileSpecification fs, String mimeType, boolean playOnDisplay) Creates a screen PdfAnnotationReturns an indirect reference to the annotationintGetter for property placeInPage.booleanGetter for property annotation.booleanisForm()Getter for property form.booleanisUsed()Getter for property used.voidvoidsetAppearanceState(String state) voidsetBorder(com.aowagie.text.pdf.PdfBorderArray border) voidsetBorderStyle(com.aowagie.text.pdf.PdfBorderDictionary border) voidvoidvoidsetFlags(int flags) voidsetHighlighting(PdfName highlight) Sets the annotation's highlighting mode.voidSets the layer this annotation belongs to.voidsetMKAlternateCaption(String caption) voidsetMKAlternateIcon(PdfTemplate template) voidsetMKBackgroundColor(Color color) voidsetMKBorderColor(Color color) voidsetMKNormalCaption(String caption) voidsetMKNormalIcon(PdfTemplate template) voidsetMKRolloverCaption(String caption) voidsetMKRolloverIcon(PdfTemplate template) voidsetMKRotation(int rotation) voidsetMKTextPosition(int tp) voidSets the name of the annotation.voidsetPage(int page) voidsetPlaceInPage(int placeInPage) Places the annotation in a specified page that must be greater or equal to the current one.voidsetPopup(PdfAnnotation popup) voidsetRotate(int v) voidvoidsetUsed()Setter for property used.Methods inherited from class PdfDictionary
get, getAsArray, getAsDict, getAsName, getAsNumber, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, put, remove, size, toPdf, toStringMethods inherited from class PdfObject
getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, setContent, setIndRef, type
-
Field Details
-
FLAGS_PRINT
public static final int FLAGS_PRINTflagvalue- See Also:
-
writer
-
templates
-
form
protected boolean form -
annotation
protected boolean annotation -
used
protected boolean usedHolds value of property used.
-
-
Constructor Details
-
PdfAnnotation
public PdfAnnotation(PdfWriter writer, float llx, float lly, float urx, float ury, PdfString title, PdfString content) Constructs a newPdfAnnotationof subtype text.- Parameters:
writer- writer to putllx- position llx to putlly- position lly to puturx- position urx to putury- position ury to puttitle- title to putcontent- content to put
-
PdfAnnotation
public PdfAnnotation(PdfWriter writer, float llx, float lly, float urx, float ury, PdfAction action) Constructs a newPdfAnnotationof subtype link (Action).- Parameters:
writer- writer to putllx- position llx to putlly- position lly to puturx- position urx to putury- position ury to putaction- action to put
-
-
Method Details
-
createScreen
public static PdfAnnotation createScreen(PdfWriter writer, Rectangle rect, String clipTitle, PdfFileSpecification fs, String mimeType, boolean playOnDisplay) throws IOException Creates a screen PdfAnnotation- Parameters:
writer- Writer to createrect- Rectangle to createclipTitle- Cliptitle to createfs- FileSpecification to createmimeType- Mimetype to setplayOnDisplay- PlayOnDisplay to set- Returns:
- a screen PdfAnnotation
- Throws:
IOException- Exception of a I/O
-
getIndirectReference
Returns an indirect reference to the annotation- Returns:
- the indirect reference
-
setDefaultAppearanceString
-
setFlags
public void setFlags(int flags) -
setBorder
public void setBorder(com.aowagie.text.pdf.PdfBorderArray border) -
setBorderStyle
public void setBorderStyle(com.aowagie.text.pdf.PdfBorderDictionary border) -
setHighlighting
Sets the annotation's highlighting mode. The values can beHIGHLIGHT_NONE,HIGHLIGHT_INVERT,HIGHLIGHT_OUTLINEandHIGHLIGHT_PUSH;- Parameters:
highlight- the annotation's highlighting mode
-
setAppearanceState
-
setColor
-
setTitle
-
setPopup
-
setAction
-
isUsed
public boolean isUsed()Getter for property used.- Returns:
- Value of property used.
-
setUsed
public void setUsed()Setter for property used. -
getTemplates
-
isForm
public boolean isForm()Getter for property form.- Returns:
- Value of property form.
-
isAnnotation
public boolean isAnnotation()Getter for property annotation.- Returns:
- Value of property annotation.
-
setPage
public void setPage(int page) -
getPlaceInPage
public int getPlaceInPage()Getter for property placeInPage.- Returns:
- Value of property placeInPage.
-
setPlaceInPage
public void setPlaceInPage(int placeInPage) Places the annotation in a specified page that must be greater or equal to the current one. WithPdfStamperthe page can be any. The first page is 1.- Parameters:
placeInPage- New value of property placeInPage.
-
setRotate
public void setRotate(int v) -
setMKRotation
public void setMKRotation(int rotation) -
setMKBorderColor
-
setMKBackgroundColor
-
setMKNormalCaption
-
setMKRolloverCaption
-
setMKAlternateCaption
-
setMKNormalIcon
-
setMKRolloverIcon
-
setMKAlternateIcon
-
setMKTextPosition
public void setMKTextPosition(int tp) -
setLayer
Sets the layer this annotation belongs to.- Parameters:
layer- the layer this annotation belongs to
-
setName
Sets the name of the annotation. With this name the annotation can be identified among all the annotations on a page (it has to be unique).- Parameters:
name- name to set
-