Class SmartRedactSettings
Configures advanced settings for the smart redaction feature in the Smart Pdf Viewer. Enables users to scan documents for sensitive data based on specified patterns, review detected regions, and redact information as needed.
Inheritance
Namespace: Syncfusion.Blazor.SmartPdfViewer
Assembly: Syncfusion.Blazor.SmartPdfViewer.dll
Syntax
public class SmartRedactSettings : SfBaseComponent
Remarks
The SmartRedactSettings
class provides properties to enable smart redaction and define custom redaction patterns,
giving users granular control over what information is detected and processed for redaction.
Examples
The following example demonstrates how to declare smart redaction settings for a PDF viewer:
<SfSmartPdfViewer>
<SmartRedactSettings />
</SfSmartPdfViewer>
Constructors
SmartRedactSettings()
Declaration
public SmartRedactSettings()
Properties
ChildContent
Renders the child element
Declaration
public RenderFragment ChildContent { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.RenderFragment |
Enable
Gets or sets a value indicating whether the Smart Redact feature is enabled in the PDF viewer.
When set to false
, the Smart Redact button in the toolbar will be hidden and all redaction functionalities will be inaccessible to users.
Declaration
public bool Enable { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
Use the Enable
property to control the availability of automated redaction features within the viewer.
If set to false
, the Smart Redact toolbar button is not displayed, and users are prevented from scanning for or redacting sensitive information via the Smart Redact workflow.
This setting is helpful when you want to restrict or disable access to advanced redaction tools based on context, role, or compliance requirements.
Examples
The following example demonstrates how to enable the Smart Redact feature and ensure the button is visible in the toolbar:
<SfSmartPdfViewer>
<SmartRedactSettings Enable="false" />
</SfSmartPdfViewer>
RedactPatterns
Gets or sets a collection of custom text patterns for identifying sensitive information during smart redaction. Use this property to extend the default detection with application-specific expressions (such as ID types, personal keywords, or custom data markers).
Declaration
public string[] RedactPatterns { get; set; }
Property Value
Type | Description |
---|---|
System.String[] | A |
Remarks
By supplying redaction patterns to RedactPatterns
, you can tailor the redaction process to match specific business, regulatory, or organizational needs,
ensuring that all required information is scanned and reviewed before redacting.
Examples
The following example demonstrates how to configure custom redaction patterns for detecting social security and credit card numbers:
<SfSmartPdfViewer>
<SmartRedactSettings RedactPatterns="@redactPatterns" />
</SfSmartPdfViewer>
@code {
string[] redactPatterns = New string[] { "SSN", "Credit Card"};
}
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
OnParametersSet()
Called when the parameters are set for the component.
Declaration
protected override void OnParametersSet()