Class PdfLoadedFreeTextAnnotation
- Namespace
- Syncfusion.Pdf.Interactive
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents the loaded document PdfFreeText annotation class.
public class PdfLoadedFreeTextAnnotation : PdfLoadedStyledAnnotation, INotifyPropertyChanged
- Inheritance
-
PdfLoadedFreeTextAnnotation
- Implements
- Inherited Members
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
public PdfAnnotationIntent AnnotationIntent { get; set; }
Property Value
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
BorderColor
//Get or set the BorderColor for the free text annotation
public PdfColor BorderColor { get; set; }
Property Value
- 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
CalloutLines
//Get or set the CelloutLines for the free text annotation
public PointF[] CalloutLines { get; set; }
Property Value
- 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
Comments
Gets the annotation Comments history.
public PdfLoadedPopupAnnotationCollection Comments { get; }
Property Value
- 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
ComplexScript
Gets or sets the complex script to add different languages texts in free text annotation.
public bool ComplexScript { get; set; }
Property Value
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
Font
//Get or set the Font for the free text annotation
public PdfFont Font { get; set; }
Property Value
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
LineEndingStyle
//Get or set the Line Ending style for the free text annotation
public PdfLineEndingStyle LineEndingStyle { get; set; }
Property Value
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
LineSpacing
Gets or sets value that indicates the vertical distance between the baselines of adjacent lines of text.
public float LineSpacing { get; set; }
Property Value
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 LineSpacing
free.LineSpacing = 5.5f;
free.SetAppearance(true);
//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)
'Set the LineSpacing
free.LineSpacing = 5.5f
free.SetAppearance(True)
'save the document
document.Save("FreetextAnnotation.pdf")
document.Close(True)
Remarks
Default value is 0.
- See Also
MarkUpText
//Get or set the MarkUp text for the free text annotation
public string MarkUpText { get; set; }
Property Value
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
ReviewHistory
Gets the annotation review history.
public PdfLoadedPopupAnnotationCollection ReviewHistory { get; }
Property Value
- 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
TextAlignment
//Gets or sets the text alignment to free text annotations.
public PdfTextAlignment TextAlignment { get; set; }
Property Value
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)
- See Also
TextDirection
//Gets or sets the text direction to free text annotation.
public PdfTextDirection TextDirection { get; set; }
Property Value
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)
- See Also
TextMarkupColor
//Get or set the TextMarkupColor for the free text annotation
public PdfColor TextMarkupColor { get; set; }
Property Value
- 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
Methods
Save()
Saves an annotation.
protected override void Save()
- See Also