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)protectedPdfRedactAnnotation(PdfDictionary pdfObject)Instantiates a newPdfRedactAnnotationinstance based onPdfDictionaryinstance, that represents existing annotation object in the document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PdfStringgetDefaultAppearance()The default appearance string that shall be used in formatting the text.ColorgetInteriorColor()The interior color which is used to fill the redacted region after the affected content has been removed.intgetJustification()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.PdfStringgetOverlayText()PdfArraygetQuadPoints()An array of 8 × n numbers specifying the coordinates of n quadrilaterals in default user space.PdfStreamgetRedactRolloverAppearance()PdfBooleangetRepeat()PdfNamegetSubtype()Gets aPdfNamewhich value is a subtype of this annotation.PdfRedactAnnotationsetDefaultAppearance(AnnotationDefaultAppearance da)PdfRedactAnnotationsetDefaultAppearance(PdfString appearanceString)The default appearance string that shall be used in formatting the text.PdfRedactAnnotationsetInteriorColor(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.PdfRedactAnnotationsetInteriorColor(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.PdfRedactAnnotationsetJustification(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.PdfRedactAnnotationsetOverlayText(PdfString text)PdfRedactAnnotationsetQuadPoints(PdfArray quadPoints)Sets n quadrilaterals in default user space by passing anPdfArrayof 8 × n numbers.PdfRedactAnnotationsetRedactRolloverAppearance(PdfStream stream)PdfRedactAnnotationsetRepeat(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 newPdfRedactAnnotationinstance based onPdfDictionaryinstance, that represents existing annotation object in the document.- Parameters:
pdfObject- thePdfDictionaryrepresenting annotation object- See Also:
PdfAnnotation.makeAnnotation(PdfObject)
-
-
Method Detail
-
getSubtype
public PdfName getSubtype()
Description copied from class:PdfAnnotationGets aPdfNamewhich value is a subtype of this annotation. See ISO-320001 12.5.6, "Annotation Types" for the reference to the possible types.- Specified by:
getSubtypein 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
PdfStringthat 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- aPdfStringthat specifies the default appearance.- Returns:
- this
PdfMarkupAnnotationinstance.+
-
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
PdfArrayof 8 × n numbers specifying the coordinates of n quadrilaterals.
-
setQuadPoints
public PdfRedactAnnotation setQuadPoints(PdfArray quadPoints)
Sets n quadrilaterals in default user space by passing anPdfArrayof 8 × n numbers. Quadrilaterals are used to define the content region that is intended to be removed for a redaction annotation.- Parameters:
quadPoints- anPdfArrayof 8 × n numbers specifying the coordinates of n quadrilaterals.- Returns:
- this
PdfRedactAnnotationinstance.
-
getInteriorColor
public Color getInteriorColor()
The interior color which is used to fill the redacted region after the affected content has been removed.- Returns:
Colorof eitherDeviceGray,DeviceRgborDeviceCmyktype 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- aPdfArrayof 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 thePdfRedactAnnotationnumber of elements shall be equal to 3 (which defines DeviceRGB colour space).- Returns:
- this
PdfRedactAnnotationinstance.
-
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
PdfRedactAnnotationinstance.
-
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
PdfRedactAnnotationinstance.
-
-