Summary: Constants | Inherited Constants | Ctors | Methods | Inherited Methods | [Expand All]
public class

# Redaction

extends Markup

java.lang.Object
↳ | com.pdftron.pdf.Annot
| ↳ | com.pdftron.pdf.annots.Markup
|  | ↳ | com.pdftron.pdf.annots.Redaction

## Class Overview

A redaction annotation (PDF 1.7) identifies content that is intended to be removed from the document. The intent of redaction annotations is to enable the following process: a)Content identification. A user applies redact annotations that specify the pieces or regions of content that should be removed. Up until the next step is performed, the user can see, move and redefine these annotations. b)Content removal. The user instructs the viewer application to apply the redact annotations, after which the content in the area specified by the redact annotations is removed. In the removed content's place, some marking appears to indicate the area has been redacted. Also, the redact annotations are removed from the PDF document. Redaction annotations provide a mechanism for the first step in the redaction process (content identification). This allows content to be marked for redaction in a non-destructive way, thus enabling a review process for evaluating potential redactions prior to removing the specified content. Redaction annotations shall provide enough information to be used in the second phase of the redaction process (content removal). This phase is application-specific and requires the conforming reader to remove all content identified by the redaction annotation, as well as the annotation itself. Conforming readers that support redaction annotations shall provide a mechanism for applying content removal, and they shall remove all traces of the specified content. If a portion of an image is contained in a redaction region, that portion of the image data shall be destroyed; clipping or image masks shall not be used to hide that data. Such conforming readers shall also be diligent in their consideration of all content that can exist in a PDF document, including XML Forms Architecture (XFA) content and Extensible Metadata Platform (XMP) content.

## Summary

Constants
int | e_Centered | The Constant e_Centered.
int | e_LeftJustified | This integer list represents the Quad Format of the Redaction annotation e_LeftJustified - Overlay text is left justified e_Centered - Overlay text is centered e_RightJustified - Overlay text is right justified e_None - No justification to the overlay text.
int | e_None | The Constant e_None.
int | e_RightJustified | The Constant e_RightJustified.

[Expand] Inherited Constants
From class com.pdftron.pdf.annots.Markup
int | e_Cloudy | The Constant e_Cloudy.
int | e_None | This integer list represents the Border Effect of the Markup annotation e_None - No effect e_Cloudy - The border should appear "cloudy".
From class com.pdftron.pdf.Annot
int | e_3D | The Constant e_3D.
int | e_Caret | The Constant e_Caret.
int | e_Circle | The Constant e_Circle.
int | e_FileAttachment | The Constant e_FileAttachment.
int | e_FreeText | The Constant e_FreeText.
int | e_Highlight | The Constant e_Highlight.
int | e_Ink | The Constant e_Ink.
int | e_Line | The Constant e_Line.
int | e_Link | The Constant e_Link.
int | e_Movie | The Constant e_Movie.
int | e_Polygon | The Constant e_Polygon.
int | e_Polyline | The Constant e_Polyline.
int | e_Popup | The Constant e_Popup.
int | e_PrinterMark | The Constant e_PrinterMark.
int | e_Projection | The Constant e_Projection.
int | e_Redact | The Constant e_Redact.
int | e_RichMedia | The Constant e_RichMedia.
int | e_Screen | The Constant e_Screen.
int | e_Sound | The Constant e_Sound.
int | e_Square | The Constant e_Square.
int | e_Squiggly | The Constant e_Squiggly.
int | e_Stamp | The Constant e_Stamp.
int | e_StrikeOut | The Constant e_StrikeOut.
int | e_Text | PDF supports the standard annotation types listed in the following enumeration (plug-in extensions may add new annotation types):.
int | e_TrapNet | The Constant e_TrapNet.
int | e_Underline | The Constant e_Underline.
int | e_Unknown | The Constant e_Unknown.
int | e_Watermark | The Constant e_Watermark.
int | e_Widget | The Constant e_Widget.
int | e_action_trigger_activate | Triggered when the annotation is activated.
int | e_action_trigger_annot_blur | Triggered when the annotation loses the input focus
int | e_action_trigger_annot_down | Triggered when the mouse button is pressed inside the annotation's active area
int | e_action_trigger_annot_enter | Triggered when the cursor enters the annotation's active area
int | e_action_trigger_annot_exit | Triggered when the cursor exits the annotation's active area
int | e_action_trigger_annot_focus | Triggered when the annotation receives the input focus
int | e_action_trigger_annot_page_close | Triggered when the page containing the annotation is closed
int | e_action_trigger_annot_page_invisible | Triggered when the page containing the annotation is no longer visible in the interactive PDF processor's user interface
int | e_action_trigger_annot_page_open | Triggered when the page containing the annotation is opened
int | e_action_trigger_annot_page_visible | Triggered when the page containing the annotation becomes visible
int | e_action_trigger_annot_up | Triggered when the mouse button is released inside the annotation's active area
int | e_down | The Constant e_down.
int | e_hidden | The Constant e_hidden.
int | e_invisible | Flags specifying various characteristics of the annotation.
int | e_locked | The Constant e_locked.
int | e_locked_contents | The Constant e_locked_contents.
int | e_no_rotate | The Constant e_no_rotate.
int | e_no_view | The Constant e_no_view.
int | e_no_zoom | The Constant e_no_zoom.
int | e_normal | An annotation can define as many as three separate appearances: The normal appearance is used when the annotation is not interacting with the user.
int | e_print | The Constant e_print.
int | e_read_only | The Constant e_read_only.
int | e_rollover | The Constant e_rollover.
int | e_toggle_no_view | The Constant e_toggle_no_view.

Public Constructors
| Redaction(Obj d) Creates an Redaction annotation and initialize it using given Cos/SDF object.
| Redaction() Creates an empty Redaction annotation.
| Redaction(Annot annot) Creates an Redaction annotation and initialize it using given annotation object.

Public Methods
void | SetOverlayTextFont(String font_name) Sets the overlay font name of the Redaction annotation.
void | SetOverlayTextFontSize(double font_size) Sets the overlay font size of the Redaction annotation.
static Redaction | create(Doc doc, Rect pos) Creates a new Redaction annotation, in the specified document.
Obj | getAppFormXO() Get Overlay appearance of the Redaction annotation.
String | getOverlayText() Get Overlay text of the Redaction annotation.
String | getOverlayTextAppearance() Get Overlay text appearance of the Redaction annotation.
int | getQuadForm() Get Overlay text quadding(justification) format of the Redaction annotation.
QuadPoint | getQuadPoint(int idx) Get the QuadPoint located at a certain index of the QuadPoint array of the Redaction annotation.
int | getQuadPointCount() Get the number of QuadPoints in the QuadPoints array of the Redaction annotation.
boolean | getUseRepeat() Get the option of whether to use repeat for the Redaction annotation.
void | setAppFormXO(Obj formxo) Set Overlay appearance of the Redaction annotation.
void | setOverlayText(String title) Set Overlay text of the Redaction annotation.
void | setOverlayTextAppearance(String app) Set Overlay text appearance of the Redaction annotation.
void | setQuadForm(int form) Set Overlay text quadding(justification) format of the Redaction annotation.
void | setQuadPoint(int idx, QuadPoint qp) Set the QuadPoint to be located at a certain index of the QuadPoint array of the Redaction annotation.
void | setUseRepeat(boolean repeat) Set the option of whether to use repeat for the Redaction annotation.

[Expand] Inherited Methods
From class com.pdftron.pdf.annots.Markup
int | getBorderEffect() Gets the Border Effect of the Markup Annotation.
double | getBorderEffectIntensity() Gets the Border Effect Intensity of the Markup Annotation.
Rect | getContentRect() Gets the inner bounding rectangle of the Square.
Date | getCreationDates() Gets the creation date of the Markup Annotation.
ColorPt | getInteriorColor() Gets the interior color of the Square.
int | getInteriorColorCompNum() Gets the number indicating interior color space of the Square.
double | getOpacity() Gets the contant opacity value corresponding to the annotation.
Rect | getPadding() Gets the rectangle difference of the Square.
Popup | getPopup() Gets the Popup object associated with this Markup annotation.
String | getSubject() Gets subject of the Markup Annotation.
String | getTitle() Gets the title of the Markup Annotation.
void | rotateAppearance(double angle) Rotates the appearance of the Markup Annotation.
void | setBorderEffect(int effect) Sets the Border Effect of the Markup Annotation.
void | setBorderEffectIntensity(double intensity) Sets the Border Effect Intensity of the Markup Annotation.
void | setContentRect(Rect cr) Sets the inner bounding rectangle of the Square.
void | setCreationDates(Date date) Sets the creation date of the Markup Annotation.
void | setInteriorColor(ColorPt cpt, int comp_num) Sets the interior color of the Square.
void | setOpacity(double opacity) Sets the contant opacity value corresponding to the annotation.
void | setPadding(double padding) Sets the rectangle difference of the Square.
void | setPadding(Rect rd) Sets the rectangle difference of the Square.
void | setPopup(Popup popup) Sets the Popup object associated with this Markup annotation.
void | setSubject(String title) Sets subject of the Markup Annotation.
void | setTitle(String title) Sets the title of the Markup Annotation.
From class com.pdftron.pdf.Annot
int | GetStructParent() Get the struct parent of an annotation.
static Annot | __Create(long impl, Object ref)
long | __GetHandle()
Object | __GetRefHandle()
static Annot | create(Doc doc, int type, Rect pos) Creates a new annotation of a given type, in the specified document.
void | deleteCustomData(String key) Deletes custom data associated with the given key.
boolean | equals(Object d) Compares two annotations for equality.
void | flatten(Page page) Flatten/Merge the existing annotation appearances with the page content and delete this annotation from a given page.
String | getActiveAppearanceState() Get the annotation's active appearance state.
Obj | getAppearance(int annot_state, String app_state) Get the annotation's appearance for the given combination of annotation and appearance states.
Obj | getAppearance() Get the annotation's appearance for the given combination of annotation and appearance states.
Obj | getAppearance(int annot_state) Get the annotation's appearance for the given combination of annotation and appearance states.
Annot.BorderStyle | getBorderStyle() Get the border style for the annotation.
ColorPt | getColorAsCMYK() Get an annotation's color.
ColorPt | getColorAsGray() Get an annotation's color.
ColorPt | getColorAsRGB() Get an annotation's color.
int | getColorCompNum() Get the color space the annotation's color is represented in.
String | getContents() Get the annotation contents.
String | getCustomData(String key) Returns custom data associated with the given key.
Date | getDate() Gets an annotation's last modified date.
boolean | getFlag(int flag) Determine if the give flag is marked flagged
Obj | getOptionalContent() Get optional content of an annotation.
Page | getPage() Get the page the annotation is associated with.
Rect | getRect() Get annoation bound rectangle
int | getRotation() Get the rotation value of the annotation.
Obj | getSDFObj() Get the SDFObj.
Obj | getTriggerAction(int trigger) Get the Action associated with the selected Annot Trigger event.
int | getType() Get the annotation type.
Obj | getUniqueID() Get the annotiation unique ID.
Rect | getVisibleContentBox() It is possible during viewing that GetRect does not return the most accurate bounding box of what is actually rendered.
int | hashCode()
boolean | isMarkup() Checks if annoation is markup.
boolean | isValid() Checks if Annot is valid.
void | refreshAppearance() Regenerates the appearance stream for the annotation.
void | refreshAppearance(RefreshOptions opts) A version of RefreshAppearance allowing custom options to make slight tweaks in behaviour.
void | removeAppearance() Removes the annotation's default appearance.
void | removeAppearance(int annot_state, String app_state) Removes the annotation's appearance for the given combination of annotation and appearance states.
void | resize(Rect pos) Resize annotation
void | setActiveAppearanceState(String astate) Set the annotation's active appearance state.
void | setAppearance(Obj app_stream, int annot_state) Set the annotation's appearance for the given combination of annotation and appearance states.
void | setAppearance(Obj app_stream) Set the annotation's appearance for the given combination of annotation and appearance states.
void | setAppearance(Obj app_stream, int annot_state, String app_state) Set the annotation's appearance for the given combination of annotation and appearance states.
void | setBorderStyle(Annot.BorderStyle bs) Set the border style for the annotation.
void | setColor(ColorPt cpt) Set an annotation's color.
void | setColor(ColorPt cpt, int comp_num) Set an annotation's color.
void | setContents(String ct) Set annotation contents.
void | setCustomData(String key, String value) Sets the custom data associated with the specified key.
void | setDate(Date date) Sets an annotation's last modified date.
void | setDateToNow() Sets an annotation's last modified date to the current time.
void | setFlag(int flag, boolean value) Set the value of given Flag.
void | setOptionalContent(Obj oc) Set optional content of an annotation.
void | setPage(Page page) Set the reference to a page the annotation is associated with.
void | setRect(Rect pos) Set the size and location of an annotation on its page.
void | setRotation(int rot) Set the rotation value of the annotation.
void | setStructParent(int keyval) Set the struct parent of an annotation.
void | setUniqueID(String icon_name) Set the unique identifier for this annotation.
From class java.lang.Object
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Constants

#### public static final int e_Centered

The Constant e_Centered.

Constant Value: 1 (0x00000001)

#### public static final int e_LeftJustified

This integer list represents the Quad Format of the Redaction annotation e_LeftJustified - Overlay text is left justified e_Centered - Overlay text is centered e_RightJustified - Overlay text is right justified e_None - No justification to the overlay text.

Constant Value: 0 (0x00000000)

#### public static final int e_None

The Constant e_None.

Constant Value: 3 (0x00000003)

#### public static final int e_RightJustified

The Constant e_RightJustified.

Constant Value: 2 (0x00000002)

## Public Constructors

#### public Redaction (Obj d)

Creates an Redaction annotation and initialize it using given Cos/SDF object.

Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.

##### Parameters

d | the input Cos/SDF object

#### public Redaction ()

Creates an empty Redaction annotation.

#### public Redaction (Annot annot)

Creates an Redaction annotation and initialize it using given annotation object.

Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.

##### Parameters

annot | the annot

##### Throws

PDFNetException |

## Public Methods

#### public void SetOverlayTextFont (String font_name)

Sets the overlay font name of the Redaction annotation.

note The OverlayTextFont is a text string specifying the overlay font name that should be used for the overlay text of the redacted region after the affected content has been removed. This entry is ignored if the Overlay appearance stream (RO) entry is present.

##### Parameters

font_name | A string containing the font name to use for the overlay text.

##### Throws

PDFNetException |

#### public void SetOverlayTextFontSize (double font_size)

Sets the overlay font size of the Redaction annotation.

be greater than 0. note The OverlayTextFontSize is a number specifying the overlay font size that should be used for the overlay text of the redacted region after the affected content has been removed. This entry is ignored if the Overlay appearance stream (RO) entry is present.

##### Parameters

font_size | The font size to use for the overlay text. The value must

##### Throws

PDFNetException |

#### public static Redaction create (Doc doc, Rect pos)

Creates a new Redaction annotation, in the specified document.

##### Parameters

doc | A document to which the annotation is added.
pos | A rectangle specifying the annotation's bounds, specified in user space coordinates.

##### Returns

- A newly created blank Circle annotation.

##### Throws

PDFNetException |

#### public Obj getAppFormXO ()

Get Overlay appearance of the Redaction annotation.

Note: This overlay overlay appearance object is a form XObject specifying the overlay appearance for this redaction annotation. After this redaction is applied and the affected content has been removed, the overlay appearance should be drawn such that its origin lines up with the lower-left corner of the annotation rectangle. This form XObject is not necessarily related to other annotation appearances, and may or may not be present in the Appearance dictionary. This entry takes precedence over the Interior Color(IC), OverlayText, OverlayTextAppearance(DA), and QuadPoint(Q) entries.

##### Returns

- An SDF object that represents the overlay overlay appearance of the Redaction annotation.

##### Throws

PDFNetException |

#### public String getOverlayText ()

Get Overlay text of the Redaction annotation.

Note: The OverlayText string is a text string specifying the overlay text that should be drawn over the redacted region after the affected content has been removed. This entry is ignored if the Overlay appearance(RO) entry is present.

##### Returns

- A string containing the overlay text of the annotation.

##### Throws

PDFNetException |

#### public String getOverlayTextAppearance ()

Get Overlay text appearance of the Redaction annotation.

Note: The overlay text appearance is the appearance string to be used in formatting the overlay text when it is drawn after the affected content has been removed. This entry is ignored if the Overlay appearance strint(RO) entry is present.

##### Returns

- A string containing the overlay text appearance of the annotation.

##### Throws

PDFNetException |

#### public int getQuadForm ()

Get Overlay text quadding(justification) format of the Redaction annotation.

Note: quadding format specifies the form of quadding (justification) to be used in laying out the overlay

##### Returns

- An entry of the "QuadForm" enum, indicating the overlay text quadding(justification) format of the Redaction annotation .

##### Throws

PDFNetException |

#### public QuadPoint getQuadPoint (int idx)

Get the QuadPoint located at a certain index of the QuadPoint array of the Redaction annotation.

Note: An array of n QuadPoints specifying If present, these quadrilaterals denote the content region that is intended to be removed. If this entry is not present, the Rect entry denotes the content region that is intended to be removed

##### Parameters

idx | The index of where the QuadPoint of interest is located.

##### Returns

- The QuadPoint located at a certain index of the QuadPoint array of the Redaction annotation.

##### Throws

PDFNetException |

#### public int getQuadPointCount ()

Get the number of QuadPoints in the QuadPoints array of the Redaction annotation.

Note: An array of n QuadPoints specifying If present, these quadrilaterals denote the content region that is intended to be removed. If this entry is not present, the Rect entry denotes the content region that is intended to be removed

##### Returns

- The number of QuadPoints.

##### Throws

PDFNetException |

#### public boolean getUseRepeat ()

Get the option of whether to use repeat for the Redaction annotation.

Note: If UseRepeat value is true, then the text specified by OverlayText should be repeated to fill the redacted region after the affected content has been removed. This entry is ignored if the RO entry is present. Default value: false.

##### Returns

- A bool indicating whether to repeat for the Redaction annotation.

##### Throws

PDFNetException |

#### public void setAppFormXO (Obj formxo)

Set Overlay appearance of the Redaction annotation. (Optional)

Note: This overlay appearance object is a form XObject specifying the overlay appearance for this redaction annotation. After this redaction is applied and the affected content has been removed, the overlay appearance should be drawn such that its origin lines up with the lower-left corner of the annotation rectangle. This form XObject is not necessarily related to other annotation appearances, and may or may not be present in the Appearance dictionary. This entry takes precedence over the Interior Color(IC), OverlayText, OverlayTextAppearance(DA), and QuadPoint(Q) entries.

##### Parameters

formxo | An SDF object that represents the overlay appearance of the Redaction annotation.

##### Throws

PDFNetException |

#### public void setOverlayText (String title)

Set Overlay text of the Redaction annotation.

Note: The OverlayText string is a text string specifying the overlay text that should be drawn over the redacted region after the affected content has been removed. This entry is ignored if the Overlay appearance(RO) entry is present.

##### Parameters

title | A string containing the overlay text of the annotation.

##### Throws

PDFNetException |

#### public void setOverlayTextAppearance (String app)

Set Overlay text appearance of the Redaction annotation.

Note: The overlay text appearance is the appearance string to be used in formatting the overlay text when it is drawn after the affected content has been removed. This entry is ignored if the Overlay appearance strint(RO) entry is present.

##### Parameters

app | A string containing the overlay text appearance of the annotation.

##### Throws

PDFNetException |

#### public void setQuadForm (int form)

Set Overlay text quadding(justification) format of the Redaction annotation.

Note: Quadding format specifies the form of quadding (justification) to be used in laying out the overlay

##### Parameters

form | An entry of the "QuadForm" enum, indicating the overlay text quadding(justification) format of the Redaction annotation .

##### Throws

PDFNetException |

#### public void setQuadPoint (int idx, QuadPoint qp)

Set the QuadPoint to be located at a certain index of the QuadPoint array of the Redaction annotation. (Optional; PDF 1.6 )

Note: An array of n QuadPoints specifying the coordinates of n quadrilaterals in default user space that comprise the region in which the link should be activated. The coordinates specifying the four vertices of the quadrilateral in counterclockwise order. For orientation purposes, such as when applying an underline border style, the bottom of a quadrilateral is the line formed by p1 and p2 of the QuadPoint. QuadPoints shall be ignored if any coordinate in the array lies outside the region specified by Rect.

##### Parameters

idx | The index position where the QuadPoint of interest is to be inserted.
qp | The QuadPoint to be inserted at that position.

##### Throws

PDFNetException |

#### public void setUseRepeat (boolean repeat)

Set the option of whether to use repeat for the Redaction annotation.

Note: If UseRepeat value is true, then the text specified by OverlayText should be repeated to fill the redacted region after the affected content has been removed. This entry is ignored if the RO entry is present. Default value: false.

##### Parameters

repeat | the new use repeat

##### Throws

PDFNetException |