Package com.itextpdf.kernel.pdf.annot
Class PdfMarkupAnnotation
java.lang.Object
com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
com.itextpdf.kernel.pdf.annot.PdfAnnotation
com.itextpdf.kernel.pdf.annot.PdfMarkupAnnotation
- Direct Known Subclasses:
-
PdfCaretAnnotation
,PdfCircleAnnotation
,PdfFileAttachmentAnnotation
,PdfFreeTextAnnotation
,PdfInkAnnotation
,PdfLineAnnotation
,PdfPolyGeomAnnotation
,PdfRedactAnnotation
,PdfSoundAnnotation
,PdfSquareAnnotation
,PdfStampAnnotation
,PdfTextAnnotation
,PdfTextMarkupAnnotation
This is a super class for the annotations which are defined as markup annotations because they are used primarily to mark up PDF documents. These annotations have text that appears as part of the annotation and may be displayed in other ways by a conforming reader, such as in a Comments pane. See also ISO-320001 12.5.6.2 "Markup Annotations".
-
Field Summary
FieldsFields inherited from class com.itextpdf.kernel.pdf.annot.PdfAnnotation
Accepted, Canceled, Completed, HIDDEN, HIGHLIGHT_INVERT, HIGHLIGHT_NONE, HIGHLIGHT_OUTLINE, HIGHLIGHT_PUSH, HIGHLIGHT_TOGGLE, INVISIBLE, LOCKED, LOCKED_CONTENTS, Marked, MarkedModel, NO_ROTATE, NO_VIEW, NO_ZOOM, None, page, PRINT, READ_ONLY, Rejected, ReviewModel, STYLE_BEVELED, STYLE_DASHED, STYLE_INSET, STYLE_SOLID, STYLE_UNDERLINE, TOGGLE_NO_VIEW, Unmarked
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
PdfMarkupAnnotation
(Rectangle rect) protected
PdfMarkupAnnotation
(PdfDictionary pdfObject) Instantiates a newPdfMarkupAnnotation
instance based onPdfDictionary
instance, that represents existing annotation object in the document. -
Method Summary
Modifier and TypeMethodDescriptionThe date and time when the annotation was created.An external data dictionary specifying data that shall be associated with the annotation.An annotation that this annotation is "in reply to." Both annotations shall be on the same page of the document.An annotation object that this annotation is "in reply to." Both annotations shall be on the same page of the document.A name describing the intent of the markup annotation.The constant opacity value that will be used in painting the annotation.getPopup()
An associated pop-up annotation for entering or editing the text associated with this annotation.An associated pop-up annotation object.A name specifying the relationship (the "reply type") between this annotation and one specified by IRT entry (seegetInReplyTo()
).A rich text string (see ISO-320001 12.7.3.4, "Rich Text Strings") that shall be displayed in the pop-up window when the annotation is opened.Text representing a short description of the subject being addressed by the annotation.getText()
The text label that will be displayed in the title bar of the annotation's pop-up window when open and active.setCreationDate
(PdfString creationDate) Sets the date and time when the annotation was created.setExternalData
(PdfDictionary exData) Sets an external data dictionary specifying data that shall be associated with the annotation.setInReplyTo
(PdfAnnotation inReplyTo) Sets an annotation that this annotation is "in reply to." Both annotations shall be on the same page of the document.Sets a name describing the intent of the markup annotation.setOpacity
(PdfNumber ca) Sets the constant opacity value that will be used in painting the annotation.setPopup
(PdfPopupAnnotation popup) Sets a pop-up annotation for entering or editing the text associated with this annotation.setReplyType
(PdfName replyType) Sets the relationship (the "reply type") between this annotation and one specified by IRT entry (seesetInReplyTo(PdfAnnotation)
).setRichText
(PdfObject richText) Sets a rich text string (see ISO-320001 12.7.3.4, "Rich Text Strings") that shall be displayed in the pop-up window when the annotation is opened.setSubject
(PdfString subject) Sets the text representing a short description of the subject being addressed by the annotation.Sets the text label that will be displayed in the title bar of the annotation's pop-up window when open and active.Methods inherited from class com.itextpdf.kernel.pdf.annot.PdfAnnotation
addAssociatedFile, flush, getAppearanceDictionary, getAppearanceObject, getAppearanceState, getAssociatedFiles, getBlendMode, getBorder, getColorObject, getContents, getDate, getDownAppearanceObject, getFlags, getLang, getName, getNonStrokingOpacity, getNormalAppearanceObject, getPage, getPageObject, getRectangle, getRolloverAppearanceObject, getStrokingOpacity, getStructParentIndex, getSubtype, getTitle, hasFlag, isWrappedObjectMustBeIndirect, makeAnnotation, put, remove, resetFlag, setAppearance, setAppearance, setAppearanceState, setBlendMode, setBorder, setBorder, setColor, setColor, setColor, setContents, setContents, setDate, setDownAppearance, setDownAppearance, setFlag, setFlags, setLang, setLayer, setName, setNonStrokingOpacity, setNormalAppearance, setNormalAppearance, setPage, setRectangle, setRolloverAppearance, setRolloverAppearance, setStrokingOpacity, setStructParentIndex, setTitle
Methods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
Field Details
-
inReplyTo
-
popup
-
-
Constructor Details
-
PdfMarkupAnnotation
-
PdfMarkupAnnotation
Instantiates a newPdfMarkupAnnotation
instance based onPdfDictionary
instance, that represents existing annotation object in the document.- Parameters:
-
pdfObject
- thePdfDictionary
representing annotation object - See Also:
-
-
Method Details
-
getText
The text label that will be displayed in the title bar of the annotation's pop-up window when open and active. This entry shall identify the user who added the annotation.- Returns:
-
PdfString
which value is an annotation text label content or null if text is not specified.
-
setText
Sets the text label that will be displayed in the title bar of the annotation's pop-up window when open and active. This entry shall identify the user who added the annotation.- Parameters:
-
text
-PdfString
which value is an annotation text label content. - Returns:
-
this
PdfMarkupAnnotation
instance.
-
getOpacity
The constant opacity value that will be used in painting the annotation. This value is applied to all visible elements of the annotation in its closed state (including its background and border) but not to the pop-up window that appears when the annotation is opened. Default value: 1.0.- Returns:
-
a
PdfNumber
which value is in range between 0 and 1, which specifies the level of opacity. This method returns null if opacity is not specified; in this case default value is used, which is 1.
-
setOpacity
Sets the constant opacity value that will be used in painting the annotation.- Parameters:
-
ca
- aPdfNumber
which value is in range between 0 and 1, which specifies the level of opacity. - Returns:
-
this
PdfMarkupAnnotation
instance. - See Also:
-
getRichText
A rich text string (see ISO-320001 12.7.3.4, "Rich Text Strings") that shall be displayed in the pop-up window when the annotation is opened.- Returns:
- text string or text stream that specifies rich text or null if rich text is not specified.
-
setRichText
Sets a rich text string (see ISO-320001 12.7.3.4, "Rich Text Strings") that shall be displayed in the pop-up window when the annotation is opened.- Parameters:
-
richText
- text string or text stream that specifies rich text. - Returns:
-
this
PdfMarkupAnnotation
instance.
-
getCreationDate
The date and time when the annotation was created.- Returns:
-
a
PdfString
which value should be in the date format specified in (ISO-320001 7.9.4, "Dates").
-
setCreationDate
Sets the date and time when the annotation was created.- Parameters:
-
creationDate
-PdfString
which value should be in the date format specified in (ISO-320001 7.9.4, "Dates"). - Returns:
-
this
PdfMarkupAnnotation
instance.
-
getInReplyToObject
An annotation object that this annotation is "in reply to." Both annotations shall be on the same page of the document. The relationship between the two annotations shall be specified by the RT entry (seegetReplyType()
).- Returns:
-
a
PdfDictionary
that represents an annotation that this annotation is "in reply to."
-
getInReplyTo
An annotation that this annotation is "in reply to." Both annotations shall be on the same page of the document. The relationship between the two annotations shall be specified by the RT entry (seegetReplyType()
).- Returns:
-
a
PdfAnnotation
that this annotation is "in reply to."
-
setInReplyTo
Sets an annotation that this annotation is "in reply to." Both annotations shall be on the same page of the document. The relationship between the two annotations shall be specified by the RT entry (seegetReplyType()
).- Parameters:
-
inReplyTo
- aPdfAnnotation
that this annotation is "in reply to." - Returns:
-
this
PdfMarkupAnnotation
instance.
-
setPopup
Sets a pop-up annotation for entering or editing the text associated with this annotation. Pop-up annotation defines an associated with this annotation pop-up window that may contain text. The Contents (seePdfAnnotation.setContents(PdfString)
) entry of the annotation that has an associated popup specifies the text that shall be displayed when the pop-up window is opened.- Parameters:
-
popup
- anPdfPopupAnnotation
that will be associated with this annotation. - Returns:
-
this
PdfMarkupAnnotation
instance.
-
getPopupObject
An associated pop-up annotation object. SeegetPopup()
for more info.- Returns:
-
a
PdfDictionary
that represents an associated pop-up annotation, or null if popup annotation is not specified.
-
getPopup
An associated pop-up annotation for entering or editing the text associated with this annotation. Pop-up annotation defines an associated with this annotation pop-up window that may contain text. The Contents (seePdfAnnotation.getContents()
) entry of the annotation that has an associated popup specifies the text that shall be displayed when the pop-up window is opened.- Returns:
-
an
PdfPopupAnnotation
that is associated with this annotation, or null if there is none.
-
getSubject
Text representing a short description of the subject being addressed by the annotation.- Returns:
-
a
PdfString
which value is a annotation subject.
-
setSubject
Sets the text representing a short description of the subject being addressed by the annotation.- Parameters:
-
subject
- aPdfString
which value is a annotation subject. - Returns:
-
this
PdfMarkupAnnotation
instance.
-
getReplyType
A name specifying the relationship (the "reply type") between this annotation and one specified by IRT entry (seegetInReplyTo()
). Valid values are:PdfName.R
- The annotation shall be considered a reply to the annotation specified by IRT. Conforming readers shall not display replies to an annotation individually but together in the form of threaded comments.PdfName.Group
- The annotation shall be grouped with the annotation specified by IRT.
-
setReplyType
Sets the relationship (the "reply type") between this annotation and one specified by IRT entry (seesetInReplyTo(PdfAnnotation)
). For valid values seegetInReplyTo()
.- Parameters:
-
replyType
- aPdfName
specifying relationship with the specified by the IRT entry. - Returns:
-
this
PdfMarkupAnnotation
instance.
-
getIntent
A name describing the intent of the markup annotation. SeesetIntent(PdfName)
for more info.- Returns:
-
a
PdfName
describing the intent of the markup annotation, or null if not specified.
-
setIntent
Sets a name describing the intent of the markup annotation. Intents allow conforming readers to distinguish between different uses and behaviors of a single markup annotation type. If this entry is not present or its value is the same as the annotation type, the annotation shall have no explicit intent and should behave in a generic manner in a conforming reader.See ISO-320001, free text annotations (Table 174), line annotations (Table 175), polygon annotations (Table 178), and polyline annotations (Table 178) for the specific intent values for those types.
- Parameters:
-
intent
- aPdfName
describing the intent of the markup annotation. - Returns:
-
this
PdfMarkupAnnotation
instance.
-
getExternalData
An external data dictionary specifying data that shall be associated with the annotation. This dictionary contains the following entries:PdfName.Type
- (optional) If present, shall bePdfName.ExData
.PdfName.Subtype
- (required) a name specifying the type of data that the markup annotation shall be associated with. The only defined value isPdfName.Markup3D
. Table 298 (ISO-320001) lists the values that correspond to a subtype of Markup3D (See alsoPdf3DAnnotation
).
- Returns:
-
An external data
PdfDictionary
, or null if not specified.
-
setExternalData
Sets an external data dictionary specifying data that shall be associated with the annotation. This dictionary should contain the following entries:PdfName.Type
- (optional) If present, shall bePdfName.ExData
.PdfName.Subtype
- (required) a name specifying the type of data that the markup annotation shall be associated with. The only defined value isPdfName.Markup3D
. Table 298 (ISO-320001) lists the values that correspond to a subtype of Markup3D (See alsoPdf3DAnnotation
).
- Parameters:
-
exData
- the external data dictionary - Returns:
-
this
PdfMarkupAnnotation
instance
-