Class RedactionProperties
Represents the information related to a redaction annotation, such as overlay text and appearance settings.
Namespace: Syncfusion.Blazor.SfPdfViewer
Assembly: Syncfusion.Blazor.SfPdfViewer.dll
Syntax
public class RedactionProperties : AnnotationProperties
Remarks
The RedactionProperties class is used to configure the properties of a redaction annotation in a PDF document.
This includes settings such as overlay text that appears on the redacted area.
It is used in conjunction with the PdfAnnotation object to apply redactions in the SfPdfViewer.
Examples
The following example demonstrates how to create a redaction annotation with overlay text:
PdfAnnotation annotation = new PdfAnnotation()
{
Id = "redaction_Annotation",
AnnotationProperties = new RedactionProperties
{
OverlayText = "Confidential"
}
};
await SfPdfViewer2.AddAnnotationAsync(annotation);
Constructors
RedactionProperties()
Declaration
public RedactionProperties()
Properties
IsRepeat
Gets or sets a value indicating whether the overlay text should be repeated within the redaction area.
Declaration
public bool IsRepeat { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | A System.Boolean value indicating whether the overlay text should be repeated across the redaction area. |
Remarks
When set to true, the overlay text will be repeated across the redaction area, helping to fill the entire redaction space with the specified text.
When set to false, the text will not repeat.
The default value is false.
Examples
PdfAnnotation annotation = new PdfAnnotation()
{
Id = "redaction_Annotation",
AnnotationProperties = new RedactionProperties
{
OverlayText = "Confidential",
IsRepeat = true // Repeat text across the redaction area
},
Type = AnnotationType.Redaction
};
await SfPdfViewer2.AddAnnotationAsync(annotation);
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 border color of the redaction marker in CSS color format. |
Remarks
This property defines the color used for the border of the redaction marker.
The border color can be set using any valid CSS color string (e.g., "#FF0000", "green", or "rgba(255, 0, 0, 1)").
The default value is "#000000", which represents a black border for the redaction marker.
Examples
PdfAnnotation annotation = new PdfAnnotation()
{
Id = "redaction_Annotation",
AnnotationProperties = new RedactionProperties
{
MarkerOpacity = 0.5,
MarkerBorderColor = "#FF0000"
}
};
await SfPdfViewer2.AddAnnotationAsync(annotation);
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. |
Remarks
This property defines the color used for the fill of the redaction marker.
The fill color can be set using any valid CSS color string (e.g., "#FF0000", "green", or "rgba(255, 0, 0, 0.5)").
The default value is "#FFFFFF", which represents a white fill for the redaction marker.
Examples
PdfAnnotation annotation = new PdfAnnotation()
{
Id = "redaction_Annotation",
AnnotationProperties = new RedactionProperties
{
MarkerFillColor = "#0000FF"
}
};
await SfPdfViewer2.AddAnnotationAsync(annotation);
MarkerOpacity
Gets or sets the opacity level of the redaction marker.
Declaration
public double MarkerOpacity { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | A System.Double representing the opacity level of the redaction marker. |
Remarks
This property defines the transparency level of the redaction marker.
The value should be between 0.0 (fully transparent) and 1.0 (fully opaque).
A value of 0.5 would make the marker semi-transparent, while 1.0 would make it fully opaque.
The default value is 1.0, which means the redaction marker is fully opaque.
Examples
PdfAnnotation annotation = new PdfAnnotation()
{
Id = "redaction_Annotation",
PageNumber = 0,
AnnotationProperties = new RedactionProperties
{
MarkerFillColor = "#00FF00",
MarkerOpacity = 0.5
}
};
await SfPdfViewer2.AddAnnotationAsync(annotation);
OverlayText
Gets or sets the overlay text displayed within the redaction annotation.
Declaration
public string OverlayText { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | A System.String representing the overlay text displayed within the redaction annotation.
The default value is an empty string ( |
Remarks
This property allows you to specify custom text that will appear in the redaction area. The overlay text can be useful for marking sections of a document as redacted with a label such as "Confidential". The default value is an empty string.
Examples
PdfAnnotation annotation = new PdfAnnotation()
{
Id = "redaction_Annotation",
AnnotationProperties = new RedactionProperties
{
OverlayText = "Hello"
}
};
await SfPdfViewer2.AddAnnotationAsync(annotation);