menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfViewerRedactionSettings - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfViewerRedactionSettings

    Provides customization options for redaction annotations in the PDF Viewer.

    Inheritance
    System.Object
    PdfViewerAnnotationSettings
    PdfViewerShapeSettings
    PdfViewerRedactionSettings
    Inherited Members
    PdfViewerAnnotationSettings.AllowedInteractions
    PdfViewerAnnotationSettings.Author
    PdfViewerAnnotationSettings.ChildContent
    PdfViewerAnnotationSettings.CustomData
    PdfViewerAnnotationSettings.GetJSNamespace()
    PdfViewerAnnotationSettings.IsLock
    PdfViewerAnnotationSettings.IsPrint
    PdfViewerAnnotationSettings.jsProperty
    PdfViewerAnnotationSettings.mainParent
    PdfViewerAnnotationSettings.MaxHeight
    PdfViewerAnnotationSettings.MaxWidth
    PdfViewerAnnotationSettings.MinHeight
    PdfViewerAnnotationSettings.MinWidth
    PdfViewerAnnotationSettings.SkipDownload
    PdfViewerAnnotationSettings.SkipPrint
    PdfViewerShapeSettings.AnnotationSelectorSettings
    PdfViewerShapeSettings.BorderDashArray
    PdfViewerShapeSettings.FillColor
    PdfViewerShapeSettings.Opacity
    PdfViewerShapeSettings.StrokeColor
    PdfViewerShapeSettings.Thickness
    PdfViewerShapeSettings.UpdateChildProperties(PdfViewerAnnotationSelectorSettings)
    Namespace: Syncfusion.Blazor.SfPdfViewer
    Assembly: Syncfusion.Blazor.SfPdfViewer.dll
    Syntax
    public class PdfViewerRedactionSettings : PdfViewerShapeSettings
    Remarks

    The PdfViewerRedactionSettings 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.

    Examples
    
    
    
    
    
    
    
    @code {
        string OverlayText = "Confidential";
        string MarkerFillColor = "#000000";
        string MarkerBorderColor = "Gray";
        bool IsRepeat = false;
        string FillColor = "#FF0000";
        string FontColor = "#FFFFFF";
        double FontSize = 16;
        string FontFamily = "Arial";
        TextAlignment TextAlignment = TextAlignment.Center;
    }

    Constructors

    PdfViewerRedactionSettings()

    Initializes a new instance of the PdfViewerRedactionSettings class.

    Declaration
    public PdfViewerRedactionSettings()

    Properties

    FontColor

    Gets or sets the font color of the overlay text in the redaction annotation.

    Declaration
    public string FontColor { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the color of the overlay text in CSS color format.
    Default is "rgba(255, 0, 0, 1)".

    Remarks

    Specifies the color used for the overlay text displayed within the redacted area.
    The value must be a valid CSS color string (e.g., "#FF0000", "red", or "rgba(255, 0, 0, 1)").
    This setting allows you to control the visibility and contrast of the overlay text against the redaction fill color. The default value is "rgba(255, 0, 0, 1)", which represents solid red.

    Examples
    
    
    
    
    

    FontFamily

    Gets or sets the font family used for the overlay text in the redaction annotation.

    Declaration
    public string FontFamily { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the font family to be applied to the redaction overlay text.
    Default is "Helvetica".

    Remarks

    Defines the font style of the overlay text that appears on the redacted area.
    You can use standard font family names such as Arial, Courier, Helvetica, or any other supported font. The default value is "Helvetica".

    Examples
    
    
    
    
    

    FontSize

    Gets or sets the font size of the overlay text in the redaction annotation.

    Declaration
    public double FontSize { get; set; }
    Property Value
    Type Description
    System.Double

    A System.Double value representing the size of the overlay text in points.
    Default is 16.

    Remarks

    This property determines the size of the overlay text displayed within the redacted area.
    Larger values result in bigger text, while smaller values produce smaller text.
    The unit is in points (pt). The default value is 16.

    Examples
    
    
    
    
    

    IsRepeat

    Gets or sets a value indicating whether the overlay text should repeat to fill the redaction area.

    Declaration
    public bool IsRepeat { get; set; }
    Property Value
    Type Description
    System.Boolean

    A System.Boolean value indicating whether to repeat the overlay text in the redaction annotation.
    Default is false.

    Remarks

    When this property is set to true, the specified OverlayText will repeat across the entire bounds of the redaction annotation. If set to false, the overlay text will be displayed only once, centered within the redaction area. This is useful for scenarios where you want the redacted content to show a repeated pattern of text like "Confidential" or "Redacted". The default value is false.

    Examples
    
    
    
    
    

    JsNamespace

    Declaration
    protected override string JsNamespace { get; set; }
    Property Value
    Type
    System.String
    Overrides
    PdfViewerShapeSettings.JsNamespace

    JsProperty

    Declaration
    protected override string JsProperty { get; set; }
    Property Value
    Type
    System.String
    Overrides
    PdfViewerShapeSettings.JsProperty

    MainParent

    Declaration
    protected override SfBaseComponent MainParent { get; set; }
    Property Value
    Type
    SfBaseComponent
    Overrides
    PdfViewerShapeSettings.MainParent

    MarkerBorderColor

    Gets or sets the border color of the redaction marker.

    Declaration
    public string MarkerBorderColor { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the color of the border surrounding the redaction marker in CSS color format.
    Default is "rgba(255, 0, 0, 1)".

    Remarks

    This property defines the color of the border surrounding the redaction area.
    You can specify the border color using a valid CSS color string (e.g., "#FF0000", "blue", or "rgba(255, 0, 0, 1)"). The default value is "rgba(255, 0, 0, 1)", which represents a solid red border around the redaction marker.

    Examples
    
    
    
    
    

    MarkerFillColor

    Gets or sets the fill color of the redaction marker.

    Declaration
    public string MarkerFillColor { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the fill color of the redaction marker in CSS color format.
    Default is "rgba(255, 255, 255, 1)".

    Remarks

    This property defines the color used to fill the redaction area.
    The fill color can be set using any valid CSS color string (e.g., "#FFFFFF", "green", or "rgba(255, 255, 255, 1)"). The default value is "rgba(255, 255, 255, 1)", which represents a white fill for the redaction marker.

    Examples
    
    
    
    
    

    MarkerOpacity

    Gets or sets the opacity of the redaction marker.

    Declaration
    public double MarkerOpacity { get; set; }
    Property Value
    Type Description
    System.Double

    A System.Double value representing the opacity of the redaction marker, ranging from 0 (fully transparent) to 1 (fully opaque).
    Default is 1.

    Remarks

    This property controls the transparency of the redaction marker's fill and border.
    A value of 1 represents full opacity (no transparency), while a value of 0 represents full transparency (completely invisible). The default value is 1, meaning the redaction marker is fully opaque.

    Examples
    
    
    
    
    

    OverlayText

    Gets or sets the text to be displayed as an overlay in the redaction annotation.

    Declaration
    public string OverlayText { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the overlay text to use for redaction.
    Default is String.Empty.

    Remarks

    Specifies the string that will appear over the redacted area.
    If IsRepeat is true, this text will repeat to fill the redaction bounds; otherwise it appears only once. The default value is an empty string.

    Examples
    
    
    
    
    

    SfTagIndex

    Declaration
    protected override int SfTagIndex { get; set; }
    Property Value
    Type
    System.Int32
    Overrides
    PdfViewerShapeSettings.SfTagIndex

    TextAlignment

    Gets or sets the alignment of the overlay text displayed in the redaction annotation.

    Declaration
    public TextAlignment TextAlignment { get; set; }
    Property Value
    Type
    TextAlignment
    Remarks

    This property defines how the overlay text is aligned within the bounds of the redaction area. Supported alignment options are Left, Center, and Right. Adjust this property to control the visual positioning of the redaction text.

    Examples
    
    
    
    
    
    

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder
    Overrides
    PdfViewerAnnotationSettings.BuildRenderTree(RenderTreeBuilder)

    OnInitializedAsync()

    Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type
    System.Threading.Tasks.Task
    Overrides
    PdfViewerShapeSettings.OnInitializedAsync()

    OnParametersSetAsync()

    Method invoked when the component has received parameters from its parent in the render tree, and the incoming values have been assigned to properties.

    Declaration
    protected override Task OnParametersSetAsync()
    Returns
    Type
    System.Threading.Tasks.Task
    Overrides
    PdfViewerShapeSettings.OnParametersSetAsync()
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved