WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfLoadedFreeTextAnnotation

    Show / Hide Table of Contents

    Class PdfLoadedFreeTextAnnotation

    Represents the loaded document PdfFreeText annotation class.

    Inheritance
    System.Object
    PdfAnnotation
    PdfLoadedAnnotation
    PdfLoadedStyledAnnotation
    PdfLoadedFreeTextAnnotation
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    PdfLoadedStyledAnnotation.CheckFlatten()
    PdfLoadedStyledAnnotation.FlattenAnnotationTemplate(PdfTemplate, Boolean)
    PdfLoadedStyledAnnotation.Color
    PdfLoadedStyledAnnotation.Opacity
    PdfLoadedStyledAnnotation.InnerColor
    PdfLoadedStyledAnnotation.Text
    PdfLoadedStyledAnnotation.Author
    PdfLoadedStyledAnnotation.Subject
    PdfLoadedStyledAnnotation.ModifiedDate
    PdfLoadedStyledAnnotation.Name
    PdfLoadedStyledAnnotation.Bounds
    PdfLoadedStyledAnnotation.Border
    PdfLoadedStyledAnnotation.Location
    PdfLoadedStyledAnnotation.Size
    PdfLoadedStyledAnnotation.AnnotationFlags
    PdfLoadedAnnotation.ObjectID
    PdfLoadedAnnotation.SetText(String)
    PdfLoadedAnnotation.GetValues(String)
    PdfLoadedAnnotation.SetValues(String, String)
    PdfLoadedAnnotation.CreationDate
    PdfLoadedAnnotation.Type
    PdfLoadedAnnotation.Page
    PdfAnnotation.SetAppearance(Boolean)
    PdfAnnotation.Initialize()
    PdfAnnotation.CalculateBounds(RectangleF, PdfPage, PdfLoadedPage)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate, Boolean, PdfGraphics)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate, Boolean)
    PdfAnnotation.Flatten
    PdfAnnotation.FlattenPopUps
    PdfAnnotation.PdfTag
    PdfAnnotation.Layer
    PdfAnnotation.Rotate
    PdfAnnotation.PropertyChanged
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Pdf.Interactive
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfLoadedFreeTextAnnotation : PdfLoadedStyledAnnotation, IPdfWrapper, INotifyPropertyChanged
    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Load the existing Page on document
    PdfLoadedPage lPage = document.Pages[0] as PdfLoadedPage;
    //load the annotation collection on this page
    PdfLoadedAnnotationCollection collection = lPage.Annotations;
    //Get the Annotation from the loaded page
    PdfLoadedFreeTextAnnotation  free = collection[0] as PdfLoadedFreeTextAnnotation;
    //Get the Annotation position
    RectangleF rectangle = free.Bounds;
    //Set a new position
    free.Bounds = new RectangleF(200, 100, 150, 50);
    //Set Annotation Border
    free.Border= new PdfAnnotationBorder(3f);
    //save the document
    document.Save("FreetextAnnotation.pdf");
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Load the existing Page on document
    Dim lPage As PdfLoadedPage = document.Pages(0)
    'load the annotation collection on this page
    Dim collection As PdfLoadedAnnotationCollection = lPage.Annotations
    'Get the Annotation from the loaded page
    Dim free As PdfLoadedFreeTextAnnotation = collection(0)
    'Get the Annotation position
    Dim rectangle As RectangleF = free.Bounds
    'Set a new position
    free.Bounds = new RectangleF(200, 100, 150, 50)
    'Set Annotation Border
    free.Border= new PdfAnnotationBorder(3f)
    'save the document
    document.Save("FreetextAnnotation.pdf")
    document.Close(True)

    Properties

    AnnotationIntent

    //Get or set the Annotation Intent for the free text annotation

    Declaration
    public PdfAnnotationIntent AnnotationIntent { get; set; }
    Property Value
    Type Description
    PdfAnnotationIntent
    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Load the existing PdfFreeTextAnnotation
    PdfLoadedFreeTextAnnotation  free = document.Pages[0].Annotations[0] as PdfLoadedFreeTextAnnotation;
    //Get the PdfAnnotation Intent
    PdfAnnotationIntent intent = free.AnnotationIntent;
    //Set the PdfAnnotation Intent
    free.AnnotationIntent = PdfAnnotationIntent.FreeTextCallout;
    //save the document
    document.Save("FreetextAnnotation.pdf");
    //Close the document
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Load the existing PdfFreeTextAnnotation
    Dim free As PdfLoadedFreeTextAnnotation = document.Pages(0).Annotations(0) 
    'Get the PdfAnnotation Intent
    Dim intent As PdfAnnotationIntent = free.AnnotationIntent
    'Set the PdfAnnotation Intent
    free.AnnotationIntent = PdfAnnotationIntent.FreeTextCallout
    'save the document
    document.Save("FreetextAnnotation.pdf")
    'Close the document
    document.Close(True)
    See Also
    PdfLoadedDocument
    PdfLoadedPage

    BorderColor

    //Get or set the BorderColor for the free text annotation

    Declaration
    public PdfColor BorderColor { get; set; }
    Property Value
    Type Description
    PdfColor

    The border color of the free text annotation.

    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Load the existing PdfFreeTextAnnotation
    PdfLoadedFreeTextAnnotation  free = document.Pages[0].Annotations[0] as PdfLoadedFreeTextAnnotation;
    //Get the BorderColor
    PdfColor borderColor = free.BorderColor;
    //Set the BorderColor
    free.BorderColor = new PdfColor(Color.Blue);
    //save the document
    document.Save("FreetextAnnotation.pdf");
    //Close the docuemnt
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Load the existing PdfFreeTextAnnotation
    Dim free As PdfLoadedFreeTextAnnotation = document.Pages(0).Annotations(0)
    'Get the BorderColor
    Dim borderColor As PdfColor = free.BorderColor
    'Set the BorderColor
    free.BorderColor = new PdfColor(Color.Blue)
    'save the document
    document.Save("FreetextAnnotation.pdf")
    'Close the document.
    document.Close(True)
    See Also
    PdfLoadedDocument
    PdfLoadedPage

    CalloutLines

    //Get or set the CelloutLines for the free text annotation

    Declaration
    public PointF[] CalloutLines { get; set; }
    Property Value
    Type Description
    System.Drawing.PointF[]
    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Load the existing PdfFreeTextAnnotation
    PdfLoadedFreeTextAnnotation  free = document.Pages[0].Annotations[0] as PdfLoadedFreeTextAnnotation;
    //Get the CelloutLines
    PointF[] celloutLines = free.CalloutLines;
    //Set the CelloutLines
    free.CalloutLines = new PointF[] { new PointF(107.234f, 550.15f), new PointF(130.023f, 811.707f), new PointF(142.023f, 811.707f) };
    //save the document
    document.Save("FreetextAnnotation.pdf");
    //Close the document
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Load the existing PdfFreeTextAnnotation
    Dim free As PdfLoadedFreeTextAnnotation = document.Pages(0).Annotations(0) as PdfLoadedFreeTextAnnotation
    'Get the CelloutLines
    Dim celloutLines As PointF() = free.CalloutLines
    'Set the CelloutLines
     free.CalloutLines = New PointF() {New PointF(107.234F, 550.15F), New PointF(130.023F, 811.707F), New PointF(142.023F, 811.707F)}
    'save the document
    document.Save("FreetextAnnotation.pdf")
    document.Close(True)
    See Also
    PdfLoadedDocument
    PdfLoadedPage

    Comments

    Gets the annotation Comments history.

    Declaration
    public PdfLoadedPopupAnnotationCollection Comments { get; }
    Property Value
    Type Description
    PdfLoadedPopupAnnotationCollection

    The Comments collection of the free text annotation.

    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Load the existing PdfFreeTextAnnotation
    PdfLoadedFreeTextAnnotation  free = document.Pages[0].Annotations[0] as PdfLoadedFreeTextAnnotation;
    //Get the Comments collection
    PdfLoadedPopupAnnotationCollection CommentsCollection = free.Comments;
    foreach (PdfLoadedPopupAnnotation popup in reviewCollection){
    //Gets the annotation state
    PdfAnnotationState state = popup.AnnotationState;
    //Gets the annotation state model 
    PdfAnnotationStateModel model = popup.AnnotationStateModel;
    }
    //save the document
    document.Save("FreetextAnnotation.pdf");
    //Close the docuemnt
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Load the existing PdfFreeTextAnnotation
    Dim free As PdfLoadedFreeTextAnnotation = document.Pages(0).Annotations(0)
    'Get the Comments collection
    Dim CommentsCollection As PdfLoadedPopupAnnotationCollection = free.Comments
    For Each popup As PdfLoadedPopupAnnotation In reviewCollection
    'Get the annotation state
    Dim state As PdfAnnotationState = popup.AnnotationState
    'Get the annotation state model
    Dim model As PdfAnnotationStateModel = popup.AnnotationStateModel
    Next
    'save the document
    document.Save("FreetextAnnotation.pdf")
    'Close the document.
    document.Close(True)
    See Also
    PdfLoadedDocument
    PdfLoadedPage

    ComplexScript

    Gets or sets the complex script to add different languages texts in free text annotation.

    Declaration
    public bool ComplexScript { get; set; }
    Property Value
    Type Description
    System.Boolean
    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Load the existing PdfFreeTextAnnotation
    PdfLoadedFreeTextAnnotation  free = document.Pages[0].Annotations[0] as PdfLoadedFreeTextAnnotation;
    //Set the Complex script
    free.ComplexScript = true;
    //Set the text
    free.Text = "पत्र‍ांक दिनांक";
    //Set Appearance
    free.SetAppearance(true);
    //Set the font
    free.Font = new PdfTrueTypeFont(new Font("Nirmala UI", 14), true);
    //save the document
    document.Save("FreetextAnnotation.pdf");
    //Close the docuemnt
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Load the existing PdfFreeTextAnnotation
    Dim free As PdfLoadedFreeTextAnnotation = document.Pages(0).Annotations(0)
    'Set the Complex script
    free.ComplexScript = True
    'Set the text
    free.Text = "पत्र‍ांक दिनांक"
    'Set Appearance
    free.SetAppearance(True)
    //Set the font
    free.Font = New PdfTrueTypeFont(New Font("Nirmala UI", 14), True)
    'save the document
    document.Save("FreetextAnnotation.pdf")
    'Close the document.
    document.Close(True)
    See Also
    PdfLoadedDocument
    PdfLoadedPage

    Font

    //Get or set the Font for the free text annotation

    Declaration
    public PdfFont Font { get; set; }
    Property Value
    Type Description
    PdfFont
    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Load the existing PdfFreeTextAnnotation
    PdfLoadedFreeTextAnnotation  free = document.Pages[0].Annotations[0] as PdfLoadedFreeTextAnnotation;
    //Get the Font
    PdfFont font = free.Font;
    //Set the Font
    free.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 15f);
    //save the document
    document.Save("FreetextAnnotation.pdf");
    //Close the document
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Load the existing PdfFreeTextAnnotation
    Dim free As PdfLoadedFreeTextAnnotation = document.Pages(0).Annotations(0)
    'Get the Font
    Dim font As PdfFont = free.Font
    'Set the Font
    free.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 15f)
    'save the document
    document.Save("FreetextAnnotation.pdf")
    'Close the document
    document.Close(True)
    See Also
    PdfLoadedDocument
    PdfLoadedPage

    LineEndingStyle

    //Get or set the Line Ending style for the free text annotation

    Declaration
    public PdfLineEndingStyle LineEndingStyle { get; set; }
    Property Value
    Type Description
    PdfLineEndingStyle
    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Load the existing PdfFreeTextAnnotation
    PdfLoadedFreeTextAnnotation  free = document.Pages[0].Annotations[0] as PdfLoadedFreeTextAnnotation;
    //Get the line ending style
    PdfLineEndingStyle style = free.LineEndingStyle;
    //Set the line ending style
    free.LineEndingStyle = PdfLineEndingStyle.OpenArrow;
    //save the document
    document.Save("FreetextAnnotation.pdf");
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Load the existing PdfFreeTextAnnotation
    Dim free As PdfLoadedFreeTextAnnotation = document.Pages(0).Annotations(0)
    'Get the line ending style
    Dim style As PdfLineEndingStyle = free.LineEndingStyle
    'Set the line ending style
    free.LineEndingStyle = PdfLineEndingStyle.OpenArrow
    'save the document
    document.Save("FreetextAnnotation.pdf")
    document.Close(True)
    See Also
    PdfLoadedPage
    PdfLoadedAnnotationCollection

    LineSpacing

    Declaration
    public float LineSpacing { get; set; }
    Property Value
    Type Description
    System.Single

    MarkUpText

    //Get or set the MarkUp text for the free text annotation

    Declaration
    public string MarkUpText { get; set; }
    Property Value
    Type Description
    System.String
    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Load the existing PdfFreeTextAnnotation
    PdfLoadedFreeTextAnnotation  free = document.Pages[0].Annotations[0] as PdfLoadedFreeTextAnnotation;
    //Get the MarkUpText
    string text= free.MarkUpText;
    //Set the MarkUpText
    free.MarkUpText = "This is Free Text Annotation";
    //save the document
    document.Save("FreetextAnnotation.pdf");
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Load the existing PdfFreeTextAnnotation
    Dim free As PdfLoadedFreeTextAnnotation = document.Pages(0).Annotations(0)
    'Get the MarkUpText
    Dim text As string = free.MarkUpText
    'Set the MarkUpText
    free.MarkUpText = "This is Free Text Annotation"
    'save the document
    document.Save("FreetextAnnotation.pdf")
    document.Close(True)
    See Also
    PdfLoadedPage
    PdfLoadedDocument

    ReviewHistory

    Gets the annotation review history.

    Declaration
    public PdfLoadedPopupAnnotationCollection ReviewHistory { get; }
    Property Value
    Type Description
    PdfLoadedPopupAnnotationCollection

    The review collection of the free text annotation.

    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Load the existing PdfFreeTextAnnotation
    PdfLoadedFreeTextAnnotation  free = document.Pages[0].Annotations[0] as PdfLoadedFreeTextAnnotation;
    //Get the review collection
    PdfLoadedPopupAnnotationCollection reviewCollection = free.ReviewHistory;
    foreach (PdfLoadedPopupAnnotation popup in reviewCollection){
    //Gets the annotation state
    PdfAnnotationState state = popup.AnnotationState;
    //Gets the annotation state model 
    PdfAnnotationStateModel model = popup.AnnotationStateModel;
    }
    //save the document
    document.Save("FreetextAnnotation.pdf");
    //Close the docuemnt
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Load the existing PdfFreeTextAnnotation
    Dim free As PdfLoadedFreeTextAnnotation = document.Pages(0).Annotations(0)
    'Get the review collection
    Dim reviewCollection As PdfLoadedPopupAnnotationCollection = free.ReviewHistory
    For Each popup As PdfLoadedPopupAnnotation In reviewCollection
    'Get the annotation state
    Dim state As PdfAnnotationState = popup.AnnotationState
    'Get the annotation state model
    Dim model As PdfAnnotationStateModel = popup.AnnotationStateModel
    Next
    'save the document
    document.Save("FreetextAnnotation.pdf")
    'Close the document.
    document.Close(True)
    See Also
    PdfLoadedDocument
    PdfLoadedPage

    TextAlignment

    //Gets or sets the text alignment to free text annotations.

    Declaration
    public PdfTextAlignment TextAlignment { get; set; }
    Property Value
    Type Description
    PdfTextAlignment
    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Load the existing PdfFreeTextAnnotation
    PdfLoadedFreeTextAnnotation  free = document.Pages[0].Annotations[0] as PdfLoadedFreeTextAnnotation;
    //Sets the text alignment of the text annotation.
    free.TextAlignment = PdfTextAlignment.Right;
    free.setAppearance(true);
    //save the document
    document.Save("FreetextAnnotation.pdf");
    //Close the document
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Load the existing PdfFreeTextAnnotation
    Dim free As PdfLoadedFreeTextAnnotation = document.Pages(0).Annotations(0) 
    'Sets the text alignment of the text annotation.
    free.TextAlignment = PdfTextAlignment.Right
    free.setAppearance(true)
    'save the document
    document.Save("FreetextAnnotation.pdf")
    'Close the document
    document.Close(True)

    TextDirection

    //Gets or sets the text direction to free text annotation.

    Declaration
    public PdfTextDirection TextDirection { get; set; }
    Property Value
    Type Description
    PdfTextDirection
    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Load the existing PdfFreeTextAnnotation
    PdfLoadedFreeTextAnnotation  free = document.Pages[0].Annotations[0] as PdfLoadedFreeTextAnnotation;
    //Sets the text alignment of the text annotation.
    free.TextAlignment = PdfTextAlignment.Right;
    free.TextDirection = PdfTextDirection.RightToLeft;
    free.setAppearance(true);
    //save the document
    document.Save("FreetextAnnotation.pdf");
    //Close the document
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Load the existing PdfFreeTextAnnotation
    Dim free As PdfLoadedFreeTextAnnotation = document.Pages(0).Annotations(0) 
    'Sets the text alignment of the text annotation.
    free.TextAlignment = PdfTextAlignment.Right
    free.TextDirection = PdfTextDirection.RightToLeft
    free.setAppearance(true)
    'save the document
    document.Save("FreetextAnnotation.pdf")
    'Close the document
    document.Close(True)

    TextMarkupColor

    //Get or set the TextMarkupColor for the free text annotation

    Declaration
    public PdfColor TextMarkupColor { get; set; }
    Property Value
    Type Description
    PdfColor

    The text markup color of the free text annotation.

    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Load the existing PdfFreeTextAnnotation
    PdfLoadedFreeTextAnnotation  free = document.Pages[0].Annotations[0] as PdfLoadedFreeTextAnnotation;
    //Get the TextMarkupColor
    PdfColor markupColor = free.TextMarkupColor;
    //Set the TextMarkupColor
    free.TextMarkupColor = new PdfColor(Color.Red);
    //save the document
    document.Save("FreetextAnnotation.pdf");
    //Close the document.
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Load the existing PdfFreeTextAnnotation
    Dim free As PdfLoadedFreeTextAnnotation = document.Pages(0).Annotations(0) as PdfLoadedFreeTextAnnotation
    'Get the TextMarkupColor
    Dim markupColor As PdfColor = free.TextMarkupColor
    'Set the TextMarkupColor
    free.TextMarkupColor = new PdfColor(Color.Red)
    'save the document
    document.Save("FreetextAnnotation.pdf")
    'Close the document.
    document.Close(True)
    See Also
    PdfLoadedDocument
    PdfLoadedPage

    Methods

    GetFontsFromAppearance()

    Declaration
    public List<PdfFont> GetFontsFromAppearance()
    Returns
    Type Description
    System.Collections.Generic.List<PdfFont>

    Save()

    Saves an annotation.

    Declaration
    protected override void Save()
    Overrides
    PdfAnnotation.Save()

    Implements

    System.ComponentModel.INotifyPropertyChanged

    See Also

    PdfLoadedPage
    PdfLoadedAnnotationCollection
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved