RedactionSettings
6 Jul 20264 minutes to read
Provides customization options for redaction annotations in the PDF Viewer.
The RedactionSettingsModel class extends PdfViewerShapeSettings and includes additional properties specifically designed to control the appearance and behavior of redaction annotations.
These settings include overlay text, fill color, font settings, and alignment, allowing users to configure how redacted content should be displayed in the PDF document.
This redaction customization feature shall be available only when the PDF Viewer is operating in Standalone Mode.
<div id="pdfViewer" style="height: 100%;width: 100%;"></div> let viewer: PdfViewer = new PdfViewer();
// Change the rectangle annotation settings.
viewer.redactionSettings = {
markerOpacity: 1,
markerBorderColor: '#ff0000',
markerFillColor: '#9c2592',
overlayText: 'Redact',
isRepeat: false,
fontColor: '#000',
fontColor: 16,
fontFamily: 'Helvetica',
textAlignment: 'Center',
fillColor: '#9c2592',
author: 'Guest',
thickness: 1,
annotationSelectorSettings: {
selectionBorderColor: '',
resizerBorderColor: 'black',
resizerFillColor: '#FF4081',
resizerSize: 8,
selectionBorderThickness: 1,
resizerShape: 'Square',
selectorLineDashArray: [],
resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges,
resizerCursorType: null
},
minHeight: 0,
minWidth: 0,
maxWidth: 0,
maxHeight: 0,
isLock: false,
allowedInteractions: ['None'],
isPrint: true
};
viewer.appendTo("#pdfViewer");Properties
allowedInteractions AllowedInteraction[]
Gets or sets the allowed interactions for the locked rectangle annotations.
IsLock can be configured using rectangle settings.
Defaults to [‘None’]
annotationSelectorSettings AnnotationSelectorSettingsModel
specifies the annotation selector settings of the annotation.
Defaults to ’’
author string
specifies the author of the annotation.
Defaults to ‘Guest’
bound Rectangle
Get or set the bounds of the annotation.
Defaults to { x: 0, y: 0, width: 0, height: 0 }
customData object
specifies the custom data of the annotation.
Defaults to null
disableConfirmationPopup boolean
If true, disables the default redaction confirmation popup.
Defaults to false
fillColor string
Gets or sets the fill color of the redacted area.
Defaults to ‘#ffffff00’
fontColor string
Gets or sets the font color of the overlay text in the redaction annotation.
Specifies the color used for the overlay text displayed within the redacted area.
Defaults to ‘#000’
fontFamily string
Gets or sets the font family used for the overlay text in the redaction annotation.
Defines the font style of the overlay text that appears on the redacted area.
Defaults to ‘Helvetica’
fontSize number
Gets or sets the font size of the overlay text in the redaction annotation.
This property determines the size of the overlay text displayed within the redacted area.
Defaults to 16
isLock boolean
specifies the locked action of the annotation.
Defaults to false
isPrint boolean
specifies whether the individual annotations are included or not in print actions.
Defaults to true
isRepeat boolean
Gets or sets a value indicating whether the overlay text should repeat to fill the redaction area.
Defaults to false
markerBorderColor string
Gets or sets the border color of the redaction marker.
This property defines the color of the border surrounding the redaction area.
Defaults to ‘rgba(255, 0, 0, 1)’
markerFillColor string
Gets or sets the fill color of the redaction marker.
This property defines the color used to fill the redaction area.
Defaults to ‘rgba(255, 255, 255, 1)’
markerOpacity number
Gets or sets the opacity of the redaction marker.
This property controls the transparency of the redaction marker’s fill and border.
Defaults to 1
maxHeight number
specifies the minHeight of the annotation.
Defaults to 0
maxWidth number
specifies the maxWidth of the annotation.
Defaults to 0
minHeight number
specifies the minHeight of the annotation.
Defaults to 0
minWidth number
specifies the minWidth of the annotation.
Defaults to 0
overlayText string
Gets or sets the text to be displayed as an overlay in the redaction annotation.
Specifies the string that will appear over the redacted area.
Defaults to ’’
pageNumber number
Get or set page number of the annotation.
Defaults to 1
subject string
specifies the subject of the annotation.
Defaults to ’’
textAlignment TextAlignment
Gets or sets the alignment of the overlay text displayed in the redaction annotation.
This property defines how the overlay text is aligned within the bounds of the redaction area.
Defaults to ‘Center’
thickness number
specified the thickness of the annotation.
Defaults to 1