java.lang.Object | |||
↳ | com.pspdfkit.annotations.Annotation | ||
↳ | com.pspdfkit.annotations.BaseRectsAnnotation | ||
↳ | com.pspdfkit.annotations.RedactionAnnotation |
Represents a redaction annotation on the document. The text marked by this annotation will be
completely removed once the redaction is applied. To mark text for redaction just place the
RedactionAnnotation
above the text, you can use getPageTextRects(int, int, int)
to find the correct bounds for the text. Any glyphs that intersect the redaction
bounding box will be redacted, they don't need to be covered completely. Call applyRedactions()
to apply the redactions persistently.
NOTE: This requires the Redaction component license to use.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
RedactionAnnotation(int pageIndex, List<RectF> rects)
Creates a new redaction annotation.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int |
getFillColor()
Returns a fill color associated with this redaction or
Color#BLACK if no color is
set. | ||||||||||
int |
getOutlineColor()
Returns the color used for the redaction's border in its preview state.
| ||||||||||
String |
getOverlayText()
Returns the text that should be displayed at the specified
rects when a redaction has
been applied. | ||||||||||
final AnnotationType |
getType()
Gets the annotation type of the annotation.
| ||||||||||
void |
setOutlineColor(int outlineColor)
Sets the color used for the redaction's border in its preview state, this color can't be
transparent and any alpha information will be removed before applying it.
| ||||||||||
void |
setOverlayText(String overlayText)
Sets the text that should be displayed at the specified
rects when a redaction has
been applied. | ||||||||||
void |
setRepeatOverlayText(boolean repeatOverlayText)
Defines whether the overlay text should be drawn only once, or repeated to fill the whole
bounding box.
| ||||||||||
boolean |
shouldRepeatOverlayText()
Returns
false if the overlay text should be drawn only once, or true if it is
repeated to fill the whole bounding box. | ||||||||||
void |
updateTransformationProperties(RectF newBoundingBox, RectF oldBoundingBox)
Annotations may override this method to transform their properties (i.e.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Creates a new redaction annotation.
NOTE: This requires the Redaction component license to use, and will
throw an InvalidPSPDFKitLicenseException
if used without it.
pageIndex | Page to which this annotation will be attached to. |
---|---|
rects | Rectangles that represent redactions for this annotation. |
InvalidPSPDFKitLicenseException | When used without Redaction component. |
---|
Returns a fill color associated with this redaction or Color#BLACK
if no color is
set. Note that alpha channel is not taken into account the exception being Color#TRANSPARENT
which allows you remove the fill color all together as long as an overlay
text is specified.
Color#BLACK
if no color is set.
Returns the color used for the redaction's border in its preview state. Defaults to a red outline if nothing is specified.
Color#RED
if none is set.
Returns the text that should be displayed at the specified rects
when a redaction has
been applied. Defaults to null
, which means no text will be displayed.
rects
when a redaction has
been applied.
Gets the annotation type of the annotation.
Sets the color used for the redaction's border in its preview state, this color can't be transparent and any alpha information will be removed before applying it.
outlineColor | Color to use for redaction border. |
---|
Sets the text that should be displayed at the specified rects
when a redaction has
been applied.
overlayText | The text that should be displayed when a redaction has been applied, or
null so no text is displayed.
|
---|
Defines whether the overlay text should be drawn only once, or repeated to fill the whole bounding box.
repeatOverlayText | true to repeat the text across the bounding box, false so the overlay text is only drawn once.
|
---|
Returns false
if the overlay text should be drawn only once, or true
if it is
repeated to fill the whole bounding box. Defaults to false
, which means the text
won't be repeated.
false
if the overlay text is only drawn once, true
if it is repeated
to fill the whole bounding box.
Annotations may override this method to transform their properties (i.e. points, rects, sizes) whenever the bounding box of the annotation changed.
newBoundingBox | New bounding box of the annotation (in PDF points). |
---|---|
oldBoundingBox | Old bounding box of the annotation (in PDF points). |