menu

Document Processing

PdfLoadedTextMarkupAnnotation Class - C# PDF Library API Reference | Syncfusion

    Show / Hide Table of Contents

    PdfLoadedTextMarkupAnnotation Class

    Represents the loaded text markup annotation class.

    Inheritance
    System.Object
    PdfAnnotation
    PdfLoadedAnnotation
    PdfLoadedStyledAnnotation
    PdfLoadedTextMarkupAnnotation
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    PdfAnnotation.CalculateBounds(RectangleF, PdfPage, PdfLoadedPage)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate, Boolean)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate, Boolean, PdfGraphics)
    PdfAnnotation.Flatten
    PdfAnnotation.FlattenPopUps
    PdfAnnotation.Initialize()
    PdfAnnotation.Layer
    PdfAnnotation.PdfTag
    PdfAnnotation.PropertyChanged
    PdfAnnotation.Rotate
    PdfAnnotation.SetAppearance(Boolean)
    PdfLoadedAnnotation.CreationDate
    PdfLoadedAnnotation.GetValues(String)
    PdfLoadedAnnotation.ObjectID
    PdfLoadedAnnotation.Page
    PdfLoadedAnnotation.SetText(String)
    PdfLoadedAnnotation.SetValues(String, String)
    PdfLoadedAnnotation.Type
    PdfLoadedStyledAnnotation.AnnotationFlags
    PdfLoadedStyledAnnotation.Author
    PdfLoadedStyledAnnotation.Border
    PdfLoadedStyledAnnotation.Bounds
    PdfLoadedStyledAnnotation.CheckFlatten()
    PdfLoadedStyledAnnotation.Color
    PdfLoadedStyledAnnotation.FlattenAnnotationTemplate(PdfTemplate, Boolean)
    PdfLoadedStyledAnnotation.InnerColor
    PdfLoadedStyledAnnotation.Location
    PdfLoadedStyledAnnotation.ModifiedDate
    PdfLoadedStyledAnnotation.Name
    PdfLoadedStyledAnnotation.Opacity
    PdfLoadedStyledAnnotation.Size
    PdfLoadedStyledAnnotation.Subject
    PdfLoadedStyledAnnotation.Text
    Namespace: Syncfusion.Pdf.Interactive
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfLoadedTextMarkupAnnotation : PdfLoadedStyledAnnotation, IPdfWrapper, INotifyPropertyChanged
    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Gets the annotation from loaded document.
    PdfLoadedTextMarkupAnnotation textMarkupAnnotation = document.Pages[1].Annotations[5] as PdfLoadedTextMarkupAnnotation;
    //Sets the PDF text markup annotation type
    textMarkupAnnotation.TextMarkupAnnotationType=PdfTextMarkupAnnotationType.Highlight
    //Sets the text markup color
    textMarkupAnnotation.TextMarkupColor=new PdfColor(Color.Blue);
    //Save the document.
    document.Save("TextMarkupAnnotation.pdf");
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Gets the annotation from loaded document.
    Dim textMarkupAnnotation As PdfLoadedTextMarkupAnnotation = document.Pages(1).Annotations(5) as PdfLoadedTextMarkupAnnotation
    'Sets the PDF text markup annotation type
     textMarkupAnnotation.TextMarkupAnnotationType=PdfTextMarkupAnnotationType.Highlight
    'Sets the text markup color
    textMarkupAnnotation.TextMarkupColor=New PdfColor(Color.Blue)
    'Save the document.
    document.Save("TextMarkupAnnotation.pdf")
    document.Close(True)

    Properties

    BoundsCollection

    Gets or sets text markup bounds collection.

    Declaration
    public List<RectangleF> BoundsCollection { get; set; }
    Property Value
    Type
    System.Collections.Generic.List<System.Drawing.RectangleF>
    Examples
                   
    //load the document
    PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");
    //Gets the annotation collection
    PdfLoadedAnnotationCollection collection = loadedDocument.Pages[0].Annotations;
    //Gets the text markup annotation
    PdfLoadedTextMarkupAnnotation pdfLoadedTextMarkup = collection[0] as PdfLoadedTextMarkupAnnotation;
    //Gets the text markup annotation bounds collection.
    List<RectangleF> boundsCollection = pdfLoadedTextMarkup.BoundsCollection;
    //Save the document
    loadedDocument.Save("Sample.pdf");
    //Close the document
    loadedDocument.Close(true);               
    //load the document
    Dim loadedDocument As PdfLoadedDocument = New PdfLoadedDocument("input.pdf")
    //Gets the annotation collection
    Dim collection As PdfLoadedAnnotationCollection = loadedDocument.Pages(0).Annotations
    //Gets the text markup annotation
    Dim pdfLoadedTextMarkup As PdfLoadedTextMarkupAnnotation = TryCast(collection(0), PdfLoadedTextMarkupAnnotation)
    //Gets the text markup annotation bounds collection.
    Dim boundsCollection As List(Of RectangleF) = pdfLoadedTextMarkup.BoundsCollection
    //Save the document
    loadedDocument.Save("Sample.pdf")
    //Close the document
    loadedDocument.Close(True)

    Comments

    Gets the annotation comments history.

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

    The Comments collection of the text markup annotation.

    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Load the existing PdfTextMarkupAnnotation
    PdfLoadedTextMarkupAnnotation  markup = document.Pages[0].Annotations[0] as PdfLoadedTextMarkupAnnotation;
    //Get the comments collection
    PdfLoadedPopupAnnotationCollection commentsCollection = markup.Comments;
    //save the document
    document.Save("TextMarkupAnnotation.pdf");
    //Close the docuemnt
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Load the existing PdfTextMarkupAnnotation
    Dim markup As PdfLoadedTextMarkupAnnotation = document.Pages(0).Annotations(0)
    'Get the comments collection
    Dim commentsCollection As PdfLoadedPopupAnnotationCollection = markup.Comments
    Next
    'save the document
    document.Save("TextMarkupAnnotation.pdf")
    'Close the document.
    document.Close(True)
    See Also
    PdfLoadedDocument
    PdfLoadedPage

    ReviewHistory

    Gets the annotation review history.

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

    The review history collection of the text markup annotation.

    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Load the existing PdfTextMarkupAnnotation
    PdfLoadedTextMarkupAnnotation  markup = document.Pages[0].Annotations[0] as PdfLoadedTextMarkupAnnotation;
    //Get the review collection
    PdfLoadedPopupAnnotationCollection reviewCollection = markup.ReviewHistory;
    //save the document
    document.Save("TextMarkupAnnotation.pdf");
    //Close the docuemnt
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Load the existing PdfTextMarkupAnnotation
    Dim markup As PdfLoadedTextMarkupAnnotation = document.Pages(0).Annotations(0)
    'Get the review collection
    Dim reviewCollection As PdfLoadedPopupAnnotationCollection = markup.ReviewHistory
    Next
    'save the document
    document.Save("TextMarkupAnnotation.pdf")
    'Close the document.
    document.Close(True)
    See Also
    PdfLoadedDocument
    PdfLoadedPage

    TextMarkupAnnotationType

    Gets or sets the markup annotation Type.

    Declaration
    public PdfTextMarkupAnnotationType TextMarkupAnnotationType { get; set; }
    Property Value
    Type
    PdfTextMarkupAnnotationType
    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Gets the annotation from loaded document.
    PdfLoadedTextMarkupAnnotation textMarkupAnnotation = document.Pages[1].Annotations[5] as PdfLoadedTextMarkupAnnotation;
    //Sets the PDF text markup annotation type
    textMarkupAnnotation.TextMarkupAnnotationType=PdfTextMarkupAnnotationType.Highlight
    //Save the document.
    document.Save("TextMarkupAnnotation.pdf");
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Gets the annotation from loaded document.
    Dim textMarkupAnnotation As PdfLoadedTextMarkupAnnotation = document.Pages(1).Annotations(5) as PdfLoadedTextMarkupAnnotation
    'Sets the PDF text markup annotation type
    textMarkupAnnotation.TextMarkupAnnotationType=PdfTextMarkupAnnotationType.Highlight
    'Save the document.
    document.Save("TextMarkupAnnotation.pdf")
    document.Close(True)

    TextMarkupColor

    Gets or sets the markup color

    Declaration
    public PdfColor TextMarkupColor { get; set; }
    Property Value
    Type
    PdfColor
    Examples
    //Load an existing document.
    PdfLoadedDocument document = new PdfLoadedDocument(@"..\..\Annotations.pdf");
    //Gets the annotation from loaded document.
    PdfLoadedTextMarkupAnnotation textMarkupAnnotation = document.Pages[1].Annotations[5] as PdfLoadedTextMarkupAnnotation;
    //Sets the text markup color
    textMarkupAnnotation.TextMarkupColor=new PdfColor(Color.Blue);
    //Save the document.
    document.Save("TextMarkupAnnotation.pdf");
    document.Close(true);
    'Load an existing document.
    Dim document As New PdfLoadedDocument("..\..\Annotations.pdf")
    'Gets the annotation from loaded document.
    Dim textMarkupAnnotation As PdfLoadedTextMarkupAnnotation = document.Pages(1).Annotations(5) as PdfLoadedTextMarkupAnnotation
    'Sets the text markup color
    textMarkupAnnotation.TextMarkupColor=New PdfColor(Color.Blue)
    'Save the document.
    document.Save("TextMarkupAnnotation.pdf")
    document.Close(True)

    Methods

    Save()

    Saves an annotation .

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

    SetTitleText(String)

    Sets the name of the field.

    Declaration
    public void SetTitleText(string text)
    Parameters
    Type Name Description
    System.String text

    Implements

    System.ComponentModel.INotifyPropertyChanged

    See Also

    PdfLoadedAttachmentAnnotation
    PdfLoadedDocumentLinkAnnotation
    PdfLoadedFileLinkAnnotation
    PdfLoadedLineAnnotation
    PdfLoadedPopupAnnotation
    PdfLoadedRubberStampAnnotation
    PdfLoadedSoundAnnotation
    PdfLoadedTextWebLinkAnnotation
    PdfLoadedUriAnnotation
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved