[]
DsPdfJS API / RedactAnnotation
Represents a redact annotation used to mark areas containing information that needs to be erased from the document. Note that redact annotations must be explicitly applied (with a call to the PdfDocument#redact method or one of its overloads) to actually remove the information marked for redaction from the document.
new RedactAnnotation(
om):RedactAnnotation
Creates a new RedactAnnotation.
ObjectManager that controls the lifetime of the RedactAnnotation.
RedactAnnotation
MarkupAnnotation.constructor
new RedactAnnotation():
RedactAnnotation
Creates a new RedactAnnotation.
RedactAnnotation
MarkupAnnotation.constructor
get area():
Quadrilateral[] |null
Gets or sets the list of Quadrilateral structures defining the annotation area. The coordinates of the quadrilaterals' points are relative to the upper left corner of the page's media box, with the Y (vertical) coordinates increasing from top to bottom.
Note that if the annotation is associated with more than one page, the media box of the first of those pages is used to calculate the coordinates.
If not empty, these quadrilaterals denote the content region that is intended to be redacted. If this list is empty, the AnnotationBase#rect entry denotes the content region that is intended to be redacted.
Quadrilateral[] | null
set area(
value):void
Gets or sets the list of Quadrilateral structures defining the annotation area. The coordinates of the quadrilaterals' points are relative to the upper left corner of the page's media box, with the Y (vertical) coordinates increasing from top to bottom.
Note that if the annotation is associated with more than one page, the media box of the first of those pages is used to calculate the coordinates.
If not empty, these quadrilaterals denote the content region that is intended to be redacted. If this list is empty, the AnnotationBase#rect entry denotes the content region that is intended to be redacted.
(Rect | Quadrilateral)[] | null
void
get color():
Color
Gets or sets the annotation color, it used as color of popup window, lines color etc.
set color(
value):void
Gets or sets the annotation color, it used as color of popup window, lines color etc.
void
get contents():
string|null
Gets or sets the text to be displayed for the annotation or, if this type of annotation does not display text, an alternate description of the annotation's contents in human-readable form. In either case, this text is useful when extracting the document's contents in support of accessibility to users with disabilities or for other purposes.
string | null
set contents(
value):void
Gets or sets the text to be displayed for the annotation or, if this type of annotation does not display text, an alternate description of the annotation's contents in human-readable form. In either case, this text is useful when extracting the document's contents in support of accessibility to users with disabilities or for other purposes.
string | null
void
get creationDate():
PdfDateTime|null
Gets or sets the date and time when the annotation was created.
PdfDateTime | null
set creationDate(
value):void
Gets or sets the date and time when the annotation was created.
PdfDateTime | null
void
get doc():
PdfDocument|null
Gets the PdfDocument owning this annotation.
PdfDocument | null
get flags():
AnnotationFlags
Gets or sets the flags specifying various characteristics of the annotation.
set flags(
value):void
Gets or sets the flags specifying various characteristics of the annotation.
void
get id():
number
Gets the reference to the object.
number
get justification():
VariableTextJustification
Gets or sets the justification to be used in displaying the overlay text. See PDF specification for details.
set justification(
value):void
Gets or sets the justification to be used in displaying the overlay text. See PDF specification for details.
void
get locked():
boolean
Gets or sets a value indicating whether the annotation can be deleted or its properties (including position and size) can be modified by the user. However, this flag does not restrict changes to the annotation's contents, such as the value of a form field.
boolean
set locked(
value):void
Gets or sets a value indicating whether the annotation can be deleted or its properties (including position and size) can be modified by the user. However, this flag does not restrict changes to the annotation's contents, such as the value of a form field.
boolean
void
get lockedContents():
boolean
Gets or sets a value indicating whether the contents of the annotation can be modified by the user. This flag does not restrict deletion of the annotation or changes to other annotation properties, such as position and size.
boolean
set lockedContents(
value):void
Gets or sets a value indicating whether the contents of the annotation can be modified by the user. This flag does not restrict deletion of the annotation or changes to other annotation properties, such as position and size.
boolean
void
MarkupAnnotation.lockedContents
get markBorderColor():
Color|null
Gets or sets the outline color used to highlight the annotation rectangle.
Color | null
set markBorderColor(
value):void
Gets or sets the outline color used to highlight the annotation rectangle.
Color | null
void
get markFillColor():
Color|null
Gets or sets the color used to fill the annotation rectangle.
Color | null
set markFillColor(
value):void
Gets or sets the color used to fill the annotation rectangle.
Color | null
void
get modifiedDate():
PdfDateTime|null
Gets or sets the date and time when the annotation was modified.
PdfDateTime | null
set modifiedDate(
value):void
Gets or sets the date and time when the annotation was modified.
PdfDateTime | null
void
get name():
string|null
Gets or sets the annotation name, a text string uniquely identifying it among all annotations on its page.
string | null
set name(
value):void
Gets or sets the annotation name, a text string uniquely identifying it among all annotations on its page.
string | null
void
get om():
ObjectManager
Gets the owner ObjectManager instance.
get opacity():
number
Gets or sets the opacity value to be used in painting the annotation. This value applies 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.
number
set opacity(
value):void
Gets or sets the opacity value to be used in painting the annotation. This value applies 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.
number
void
get overlayAppearance():
DefaultAppearance
Gets the DefaultAppearance object that specifies the visual properties (font, font size etc.) used to format the overlay text.
get overlayFillColor():
Color
Gets or sets the overlay fill color with which to fill the redacted region after the affected content has been removed.
set overlayFillColor(
value):void
Gets or sets the overlay fill color with which to fill the redacted region after the affected content has been removed.
void
get overlayText():
string|null
Gets or sets the overlay text that should be drawn over the redacted region after the affected content has been removed.
string | null
set overlayText(
value):void
Gets or sets the overlay text that should be drawn over the redacted region after the affected content has been removed.
string | null
void
get overlayTextRepeat():
boolean
Gets or sets the overlay text that should be drawn over the redacted region after the affected content has been removed.
boolean
set overlayTextRepeat(
value):void
Gets or sets the overlay text that should be drawn over the redacted region after the affected content has been removed.
boolean
void
get page():
PdfPage|null
Gets or sets the PdfPage that contains this annotation. Note that an annotation may be referenced by several pages. In that case this property returns the first element in the pages collection. When setting this property, the following applies: If the new value is null, this annotation is removed from all pages. Otherwise, this annotation is assigned exclusively to the specified page.
PdfPage | null
set page(
value):void
Gets or sets the PdfPage that contains this annotation. Note that an annotation may be referenced by several pages. In that case this property returns the first element in the pages collection. When setting this property, the following applies: If the new value is null, this annotation is removed from all pages. Otherwise, this annotation is assigned exclusively to the specified page.
PdfPage | null
void
get pages():
AnnotationPagesCollection
Gets the list of pages that reference this annotation.
get pdfArea():
Quadrilateral[] |null
Gets or sets the list of Quadrilateral structures defining the annotation area. The coordinates of the quadrilaterals' points are in PDF user space coordinates. The positive X axis extends horizontally to the right, and the positive Y axis extends vertically upward, with the origin usually in the lower left corner of the page.
If not empty, these quadrilaterals denote the content region that is intended to be redacted. If this list is empty, the AnnotationBase#rect entry denotes the content region that is intended to be redacted.
Quadrilateral[] | null
set pdfArea(
value):void
Gets or sets the list of Quadrilateral structures defining the annotation area. The coordinates of the quadrilaterals' points are in PDF user space coordinates. The positive X axis extends horizontally to the right, and the positive Y axis extends vertically upward, with the origin usually in the lower left corner of the page.
If not empty, these quadrilaterals denote the content region that is intended to be redacted. If this list is empty, the AnnotationBase#rect entry denotes the content region that is intended to be redacted.
(Rect | Quadrilateral)[] | null
void
get pdfRect():
Rect
Gets or sets the rectangle that defines the location and size of the annotation on a page in PDF user space coordinates. The positive X axis extends horizontally to the right, and the positive Y axis extends vertically upward, with the origin usually in the lower left corner of the page.
set pdfRect(
value):void
Gets or sets the rectangle that defines the location and size of the annotation on a page in PDF user space coordinates. The positive X axis extends horizontally to the right, and the positive Y axis extends vertically upward, with the origin usually in the lower left corner of the page.
void
get popup():
PopupAnnotation|null
Gets or sets the PopupAnnotation annotation for entering or editing text associated with this annotation. Setting this property changes the PopupAnnotation#parent property. A separate PopupAnnotation allows defining additional properties of the popup window: color, position etc.
PopupAnnotation | null
set popup(
value):void
Gets or sets the PopupAnnotation annotation for entering or editing text associated with this annotation. Setting this property changes the PopupAnnotation#parent property. A separate PopupAnnotation allows defining additional properties of the popup window: color, position etc.
PopupAnnotation | null
void
get rect():
Rect
Gets or sets the rectangle that defines the location and size of the annotation on a page. The coordinates of the rectangle are relative to the upper left corner of the page's media box, with the Y (vertical) coordinates increasing from top to bottom. Note that if the annotation is associated with more than one page, the media box of the first of those pages is used to calculate the rectangle's location.
set rect(
value):void
Gets or sets the rectangle that defines the location and size of the annotation on a page. The coordinates of the rectangle are relative to the upper left corner of the page's media box, with the Y (vertical) coordinates increasing from top to bottom. Note that if the annotation is associated with more than one page, the media box of the first of those pages is used to calculate the rectangle's location.
void
get referenceAnnotation():
MarkupAnnotation|null
Gets or sets the annotation referenced by this annotation.
MarkupAnnotation | null
set referenceAnnotation(
value):void
Gets or sets the annotation referenced by this annotation.
MarkupAnnotation | null
void
MarkupAnnotation.referenceAnnotation
get referenceType():
string
Gets or sets the relationship (reference type) between this annotation and the annotation specified by the 'referenceAnnotation' property. The referenced annotation should be on the same page with the current annotation. The valid values: "R" (reply), "Group"
string
set referenceType(
value):void
Gets or sets the relationship (reference type) between this annotation and the annotation specified by the 'referenceAnnotation' property. The referenced annotation should be on the same page with the current annotation. The valid values: "R" (reply), "Group"
void
MarkupAnnotation.referenceType
get richText():
string
Gets or sets the text to be displayed in the pop-up window when the annotation is opened. This text can be formatted using HTML tags, see PDF specification for details.
string
set richText(
value):void
Gets or sets the text to be displayed in the pop-up window when the annotation is opened. This text can be formatted using HTML tags, see PDF specification for details.
string | null
void
get subject():
string|null
Gets or sets the text representing a short description of the subject being addressed by the annotation.
string | null
set subject(
value):void
Gets or sets the text representing a short description of the subject being addressed by the annotation.
string | null
void
get userName():
string|null
Gets or sets the text label to be displayed in the title bar of the annotation's pop-up window when open and active. By convention, this entry identifies the user who added the annotation.
string | null
set userName(
value):void
Gets or sets the text label to be displayed in the title bar of the annotation's pop-up window when open and active. By convention, this entry identifies the user who added the annotation.
string | null
void
free():
void
Detaches the object from the ObjectManager and deallocates its memory, if possible.
void
rebind(
omTo):void
Rebinds the object from the current ObjectManager to the specified one.
The new ObjectManager for the object.
void
removeAppearance():
void
Removes all appearance streams associated with the current annotation, and disables generation of appearance steams for this annotation when the document is saved.
Note that if any property affecting the annotation's appearance 'rect' is then changed, the appearance streams will be regenerated. So this method would usually be called after initializing all annotation's properties.
void
MarkupAnnotation.removeAppearance
resetAppearance():
void
Forces regeneration of the annotation's appearance streams next time the document is saved.
void