alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class PdfViewerFreeTextSettings

    Represents the settings for free text annotations in a PDF viewer component in Blazor applications.

    Inheritance
    object
    PdfViewerAnnotationSettings
    PdfViewerFreeTextSettings
    Inherited Members
    PdfViewerAnnotationSettings.AllowedInteractions
    PdfViewerAnnotationSettings.Author
    PdfViewerAnnotationSettings.ChildContent
    PdfViewerAnnotationSettings.CustomData
    PdfViewerAnnotationSettings.IsLock
    PdfViewerAnnotationSettings.IsPrint
    PdfViewerAnnotationSettings.jsProperty
    PdfViewerAnnotationSettings.mainParent
    PdfViewerAnnotationSettings.MaxHeight
    PdfViewerAnnotationSettings.MaxWidth
    PdfViewerAnnotationSettings.MinHeight
    PdfViewerAnnotationSettings.MinWidth
    PdfViewerAnnotationSettings.SkipDownload
    PdfViewerAnnotationSettings.SkipPrint
    Namespace: Syncfusion.Blazor.SfPdfViewer
    Assembly: Syncfusion.Blazor.SfPdfViewer.dll
    Syntax
    public class PdfViewerFreeTextSettings : PdfViewerAnnotationSettings
    Remarks

    This class provides functionality to manage and initialize settings for free text annotations in a PDF viewer, including font properties, text alignment, border settings, and other related configurations for adding and displaying free text annotations. It ensures that the settings are properly initialized and updated whenever parameters are set or changed.

    Examples

    Below is an example of how to use PdfViewerFreeTextSettings in a Blazor component:

    Constructors

    PdfViewerFreeTextSettings()

    Declaration
    public PdfViewerFreeTextSettings()

    Properties

    AllowEditTextOnly

    If it is set as true, then we can't move , resize the freetext annotations in the PDF Viewer. Just we can modify the existing text content. Otherwise along with modifying text we can resize, move the existing text content.By default it is false.

    Declaration
    [Parameter]
    [JsonPropertyName("allowEditTextOnly")]
    public bool AllowEditTextOnly { get; set; }
    Property Value
    Type
    bool

    AnnotationSelectorSettings

    Defines the annotaton selector settings for the freetext annotation.

    Declaration
    [Parameter]
    [JsonPropertyName("annotationSelectorSettings")]
    public PdfViewerAnnotationSelectorSettings AnnotationSelectorSettings { get; set; }
    Property Value
    Type
    PdfViewerAnnotationSelectorSettings

    AutoFit

    Enable or disable auto fit mode for FreeText annotation in the Pdfviewer. FALSE by default.

    Declaration
    [Parameter]
    [JsonPropertyName("enableAutoFit")]
    public bool AutoFit { get; set; }
    Property Value
    Type
    bool
    Remarks

    This property allows dynamic resizing of FreeText annotations based on the text content, while respecting the defined minimum and maximum width and height constraints
    It is applicable only to FreeText annotations and does not affect other annotation types. Ensure that the constraints are properly set to avoid overflow or clipping issues, especially on different screen resolutions and browser environments.

    Examples
    @using Syncfusion.Blazor.SfPdfViewer 
    
    <SfPdfViewer2 DocumentPath="@DocumentPath" Height="800px" Width="100%"> 
        <PdfViewerFreeTextSettings AutoFit = "true" >
        </PdfViewerFreeTextSettings>
    </SfPdfViewer2> 
    
    @code { 
        private string DocumentPath { get; set; } = "wwwroot/data/sample.pdf";  
    }

    BorderColor

    Defines the border color for free text or label text for shape and measurement annotation. By default it is "#000000".

    Declaration
    [Parameter]
    [JsonPropertyName("borderColor")]
    public string BorderColor { get; set; }
    Property Value
    Type
    string

    BorderStyle

    Defines the border style for free text or label text for shape and measurement annotation. By default it is "solid".

    Declaration
    [Parameter]
    [JsonPropertyName("borderStyle")]
    public string BorderStyle { get; set; }
    Property Value
    Type
    string

    BorderThickness

    Defines the border width for free text or label text for shape and measurement annotation. By default it is "0".

    Declaration
    [Parameter]
    [JsonPropertyName("borderThickness")]
    public int BorderThickness { get; set; }
    Property Value
    Type
    int

    DefaultText

    Defines the fill color for free text or label text for shape and measurement annotation. By default it is "Type Here".

    Declaration
    [Parameter]
    [JsonPropertyName("defaultText")]
    public string DefaultText { get; set; }
    Property Value
    Type
    string

    FillColor

    Defines the fill color for free text or label text for shape and measurement annotation. By default it is "#ffffff00".

    Declaration
    [Parameter]
    [JsonPropertyName("fillColor")]
    public string FillColor { get; set; }
    Property Value
    Type
    string

    FontColor

    Defines the font color for free text or label text for shape and measurement annotation. By default it is "#000".

    Declaration
    [Parameter]
    [JsonPropertyName("fontColor")]
    public string FontColor { get; set; }
    Property Value
    Type
    string

    FontFamily

    Defines the font family for free text or label text for shape and measurement annotation. By default it is "Helvetica".

    Declaration
    [Parameter]
    [JsonPropertyName("fontFamily")]
    public string FontFamily { get; set; }
    Property Value
    Type
    string

    FontSize

    Defines the font size for free text or label text for shape and measurement annotation. By default it is "16".

    Declaration
    [Parameter]
    [JsonPropertyName("fontSize")]
    public double FontSize { get; set; }
    Property Value
    Type
    double

    FontStyle

    Defines the font style for free text or label text for shape and measurement annotation. By default it is "None".

    Declaration
    [Parameter]
    [JsonPropertyName("fontStyle")]
    public FontStyle FontStyle { get; set; }
    Property Value
    Type
    FontStyle

    Height

    Defines the height for free text or label text for shape and measurement annotation. By default it is "24.6".

    Declaration
    [Parameter]
    [JsonPropertyName("height")]
    public double Height { get; set; }
    Property Value
    Type
    double

    JsNamespace

    Gets or sets the JavaScript interop namespace for this component.

    Declaration
    protected override string JsNamespace { get; set; }
    Property Value
    Type
    string
    Overrides
    PdfViewerAnnotationSettings.JsNamespace

    JsProperty

    Gets or sets the JS interop property name used internally.

    Declaration
    protected string JsProperty { get; set; }
    Property Value
    Type
    string

    MainParent

    Gets or sets the parent base component reference.

    Declaration
    protected SfBaseComponent MainParent { get; set; }
    Property Value
    Type
    SfBaseComponent

    Opacity

    Defines the opacity for free text or label text for shape and measurement annotation. By default it is "1".

    Declaration
    [Parameter]
    [JsonPropertyName("opacity")]
    public double Opacity { get; set; }
    Property Value
    Type
    double

    SfTagIndex

    Gets or sets tag index used to compose the JS namespace within the parent hierarchy.

    Declaration
    protected override int SfTagIndex { get; set; }
    Property Value
    Type
    int
    Overrides
    PdfViewerAnnotationSettings.SfTagIndex

    TextAlignment

    Defines the text alignment for free text or label text for shape and measurement annotation. By default it is "Left".

    Declaration
    [Parameter]
    [JsonPropertyName("textAlignment")]
    [JsonConverter(typeof(JsonStringEnumConverter))]
    public TextAlignment TextAlignment { get; set; }
    Property Value
    Type
    TextAlignment

    Width

    Defines the width for free text or label text for shape and measurement annotation. By default it is "151".

    Declaration
    [Parameter]
    [JsonPropertyName("width")]
    public int Width { get; set; }
    Property Value
    Type
    int

    Methods

    BuildRenderTree(RenderTreeBuilder)

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

    OnInitializedAsync()

    Performs async initialization and sets up state and JS namespace.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type
    Task
    Overrides
    PdfViewerAnnotationSettings.OnInitializedAsync()

    OnParametersSetAsync()

    Applies parameter changes and updates child properties when needed.

    Declaration
    protected override Task OnParametersSetAsync()
    Returns
    Type
    Task
    Overrides
    PdfViewerAnnotationSettings.OnParametersSetAsync()
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved