Package com.itextpdf.kernel.pdf.annot
Class PdfRedactAnnotation
- java.lang.Object
-
- com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
-
- com.itextpdf.kernel.pdf.annot.PdfAnnotation
-
- com.itextpdf.kernel.pdf.annot.PdfMarkupAnnotation
-
- com.itextpdf.kernel.pdf.annot.PdfRedactAnnotation
-
public class PdfRedactAnnotation extends PdfMarkupAnnotation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.itextpdf.kernel.pdf.annot.PdfAnnotation
PdfAnnotation.PdfUnknownAnnotation
-
-
Field Summary
-
Fields inherited from class com.itextpdf.kernel.pdf.annot.PdfMarkupAnnotation
inReplyTo, popup
-
Fields 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
Constructors Modifier Constructor Description PdfRedactAnnotation(Rectangle rect)
protected
PdfRedactAnnotation(PdfDictionary pdfObject)
Instantiates a newPdfRedactAnnotation
instance based onPdfDictionary
instance, that represents existing annotation object in the document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PdfString
getDefaultAppearance()
The default appearance string that shall be used in formatting the text.Color
getInteriorColor()
The interior color which is used to fill the redacted region after the affected content has been removed.int
getJustification()
A code specifying the form of quadding (justification) that is used in displaying the annotation's text: 0 - Left-justified, 1 - Centered, 2 - Right-justified.PdfString
getOverlayText()
PdfArray
getQuadPoints()
An array of 8 × n numbers specifying the coordinates of n quadrilaterals in default user space.PdfStream
getRedactRolloverAppearance()
PdfBoolean
getRepeat()
PdfName
getSubtype()
Gets aPdfName
which value is a subtype of this annotation.PdfRedactAnnotation
setDefaultAppearance(AnnotationDefaultAppearance da)
PdfRedactAnnotation
setDefaultAppearance(PdfString appearanceString)
The default appearance string that shall be used in formatting the text.PdfRedactAnnotation
setInteriorColor(float[] interiorColor)
An array of numbers in the range 0.0 to 1.0 specifying the interior color which is used to fill the redacted region after the affected content has been removed.PdfRedactAnnotation
setInteriorColor(PdfArray interiorColor)
An array of numbers in the range 0.0 to 1.0 specifying the interior color which is used to fill the redacted region after the affected content has been removed.PdfRedactAnnotation
setJustification(int justification)
A code specifying the form of quadding (justification) that is used in displaying the annotation's text: 0 - Left-justified, 1 - Centered, 2 - Right-justified.PdfRedactAnnotation
setOverlayText(PdfString text)
PdfRedactAnnotation
setQuadPoints(PdfArray quadPoints)
Sets n quadrilaterals in default user space by passing anPdfArray
of 8 × n numbers.PdfRedactAnnotation
setRedactRolloverAppearance(PdfStream stream)
PdfRedactAnnotation
setRepeat(PdfBoolean repeat)
-
Methods inherited from class com.itextpdf.kernel.pdf.annot.PdfMarkupAnnotation
getCreationDate, getExternalData, getInReplyTo, getInReplyToObject, getIntent, getOpacity, getPopup, getPopupObject, getReplyType, getRichText, getSubject, getText, setCreationDate, setExternalData, setInReplyTo, setIntent, setOpacity, setPopup, setReplyType, setRichText, setSubject, setText
-
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, 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
-
-
-
-
Constructor Detail
-
PdfRedactAnnotation
public PdfRedactAnnotation(Rectangle rect)
-
PdfRedactAnnotation
protected PdfRedactAnnotation(PdfDictionary pdfObject)
Instantiates a newPdfRedactAnnotation
instance based onPdfDictionary
instance, that represents existing annotation object in the document.- Parameters:
pdfObject
- thePdfDictionary
representing annotation object- See Also:
PdfAnnotation.makeAnnotation(PdfObject)
-
-
Method Detail
-
getSubtype
public PdfName getSubtype()
Description copied from class:PdfAnnotation
Gets aPdfName
which value is a subtype of this annotation. See ISO-320001 12.5.6, "Annotation Types" for the reference to the possible types.- Specified by:
getSubtype
in classPdfAnnotation
- Returns:
- subtype of this annotation.
-
getDefaultAppearance
public PdfString getDefaultAppearance()
The default appearance string that shall be used in formatting the text. See ISO-32001 12.7.3.3, "Variable Text".- Returns:
- a
PdfString
that specifies the default appearance, or null if default appereance is not specified.
-
setDefaultAppearance
public PdfRedactAnnotation setDefaultAppearance(PdfString appearanceString)
The default appearance string that shall be used in formatting the text. See ISO-32001 12.7.3.3, "Variable Text".- Parameters:
appearanceString
- aPdfString
that specifies the default appearance.- Returns:
- this
PdfMarkupAnnotation
instance.+
-
setDefaultAppearance
public PdfRedactAnnotation setDefaultAppearance(AnnotationDefaultAppearance da)
-
setOverlayText
public PdfRedactAnnotation setOverlayText(PdfString text)
-
getOverlayText
public PdfString getOverlayText()
-
setRedactRolloverAppearance
public PdfRedactAnnotation setRedactRolloverAppearance(PdfStream stream)
-
getRedactRolloverAppearance
public PdfStream getRedactRolloverAppearance()
-
setRepeat
public PdfRedactAnnotation setRepeat(PdfBoolean repeat)
-
getRepeat
public PdfBoolean getRepeat()
-
getQuadPoints
public PdfArray getQuadPoints()
An array of 8 × n numbers specifying the coordinates of n quadrilaterals in default user space. Quadrilaterals are used to define the content region that is intended to be removed for a redaction annotation.- Returns:
- an
PdfArray
of 8 × n numbers specifying the coordinates of n quadrilaterals.
-
setQuadPoints
public PdfRedactAnnotation setQuadPoints(PdfArray quadPoints)
Sets n quadrilaterals in default user space by passing anPdfArray
of 8 × n numbers. Quadrilaterals are used to define the content region that is intended to be removed for a redaction annotation.- Parameters:
quadPoints
- anPdfArray
of 8 × n numbers specifying the coordinates of n quadrilaterals.- Returns:
- this
PdfRedactAnnotation
instance.
-
getInteriorColor
public Color getInteriorColor()
The interior color which is used to fill the redacted region after the affected content has been removed.- Returns:
Color
of eitherDeviceGray
,DeviceRgb
orDeviceCmyk
type which defines interior color of the annotation, or null if interior color is not specified.
-
setInteriorColor
public PdfRedactAnnotation setInteriorColor(PdfArray interiorColor)
An array of numbers in the range 0.0 to 1.0 specifying the interior color which is used to fill the redacted region after the affected content has been removed.- Parameters:
interiorColor
- aPdfArray
of numbers in the range 0.0 to 1.0. The number of array elements determines the colour space in which the colour is defined: 0 - No colour, transparent; 1 - DeviceGray, 3 - DeviceRGB, 4 - DeviceCMYK. For thePdfRedactAnnotation
number of elements shall be equal to 3 (which defines DeviceRGB colour space).- Returns:
- this
PdfRedactAnnotation
instance.
-
setInteriorColor
public PdfRedactAnnotation setInteriorColor(float[] interiorColor)
An array of numbers in the range 0.0 to 1.0 specifying the interior color which is used to fill the redacted region after the affected content has been removed.- Parameters:
interiorColor
- an array of floats in the range 0.0 to 1.0.- Returns:
- this
PdfRedactAnnotation
instance.
-
getJustification
public int getJustification()
A code specifying the form of quadding (justification) that is used in displaying the annotation's text: 0 - Left-justified, 1 - Centered, 2 - Right-justified. Default value: 0 (left-justified).- Returns:
- a code specifying the form of quadding (justification), returns the default value if not explicitly specified.
-
setJustification
public PdfRedactAnnotation setJustification(int justification)
A code specifying the form of quadding (justification) that is used in displaying the annotation's text: 0 - Left-justified, 1 - Centered, 2 - Right-justified. Default value: 0 (left-justified).- Parameters:
justification
- a code specifying the form of quadding (justification).- Returns:
- this
PdfRedactAnnotation
instance.
-
-