Skip to content

# PDFVisualFreeTextAnnotation

Namespace: O2S.Components.PDF4NET.View.Annotations

Defines a free text annotation that is displayed in a control.

    public class PDFVisualFreeTextAnnotation : PDFVisualAnnotation

Inheritance Object → PDFVisualAnnotation → PDFVisualFreeTextAnnotation

## Constructors

### PDFVisualFreeTextAnnotation(PDFFreeTextAnnotation)

Initializes a new PDFVisualFreeTextAnnotation object.

    public PDFVisualFreeTextAnnotation(PDFFreeTextAnnotation annotation)

Parameters

`annotation` PDFFreeTextAnnotation
The underlying PDF annotation.

## Properties

### Annotation

Gets the underlying PDF annotation.

    public PDFAnnotation Annotation { get; }

Property Value

PDFAnnotation
A PDF annotation.

### AppearanceFont

Gets or sets the annotation appearance font.

    public PDFFont AppearanceFont { get; set; }

Property Value

PDFFont
The font used for displaying the annotation content.

Remarks

If this property is null, the PDFVisualFreeTextAnnotation.Font property is used for displaying the annotation content.

### BorderColor

Gets or sets the annotation border color.

    public PDFColor BorderColor { get; set; }

Property Value

PDFColor
A specifying the border color with which to stroke the annotation's border.

Exceptions

ArgumentOutOfRangeException
Thrown when the property is set to a color other than Gray, RGB or CMYK.

Remarks

For free text annotations the border color will always match the text color and viceversa.

### BorderWidth

Gets or sets the border width.

    public double BorderWidth { get; set; }

Property Value

Double
The width of the square outline drawn in the annotation.

Exceptions

ArgumentOutOfRangeException
Thrown when this property is set to a negative value.

### Contents

Gets or sets the annotation contents.

    public string Contents { get; set; }

Property Value

String
Text to be displayed for the annotation.

### DisplayRectangle

Gets or sets the visual rectangle of this annotation.

    public PDFDisplayRectangle DisplayRectangle { get; set; }

Property Value

PDFDisplayRectangle
A that represents the position and size of the annotation on the page.

Remarks

The visual rectangle is relative to the top left corner of the page.

### Font

Gets or sets the annotation font.

    public PDFFont Font { get; set; }

Property Value

PDFFont
The font used for displaying the annotation PDFVisualFreeTextAnnotation.Contents.

### InteriorColor

Gets or sets the annotation interior color.

    public PDFColor InteriorColor { get; set; }

Property Value

PDFColor
A specifying the color to fill the annotation interior.

Exceptions

ArgumentOutOfRangeException
Thrown when the property is set to a color other than Gray, RGB or CMYK.

### NormalAppearance

Gets or sets the annotation normal appearance.

    public PDFAnnotationAppearance NormalAppearance { get; set; }

Property Value

PDFAnnotationAppearance
A specifying how the annotation is presented visually on the page.

### Tag

Gets or sets an object that contains user-defined data associated with the annotation.

    public object Tag { get; set; }

Property Value

Object

Remarks

This property can be used to store any custom information relevant to the annotation at runtime. The value is not used by the annotation itself and is intended solely for application-specific data.
NOTE: The value of this property is not persisted in the PDF file.

### TextColor

Gets or sets the text color.

    public PDFColor TextColor { get; set; }

Property Value

PDFColor
A specifying the color used to display the annotation content.

### TextDirection

Gets or sets the text direction.

    public PDFTextDirection TextDirection { get; set; }

Property Value

PDFTextDirection
A enum member specifying the direction of the text displayed in the annotation.

### VisualPage

Gets the page that owns the anotation.

    public PDFVisualPage VisualPage { get; internal set; }

Property Value

PDFVisualPage
The PDFVisualPage that owns the annotation.