Skip to content

# PDFFlowAnnotationContent

Namespace: O2S.Components.PDF4NET.FlowDocument

Defines an annotation content that can be added to a flow document.

    public class PDFFlowAnnotationContent : PDFFlowContent

Inheritance Object → PDFFlowContent → PDFFlowAnnotationContent

Remarks

This type of flow content lets you insert annotations in a flow document.

## Constructors

### PDFFlowAnnotationContent(PDFAnnotation)

Initializes a new PDFFlowAnnotationContent object.

    public PDFFlowAnnotationContent(PDFAnnotation annotation)

Parameters

`annotation` PDFAnnotation
Annotation to draw in the document.

### PDFFlowAnnotationContent(PDFAnnotation, Double, Double)

Initializes a new PDFFlowAnnotationContent object.

    public PDFFlowAnnotationContent(PDFAnnotation annotation, double width, double height)

Parameters

`annotation` PDFAnnotation
Annotation to draw in the document.

`width` Double
Width of displayed annotation.

`height` Double
Height of displayed annotation.

## Properties

### AnnotationHeight

Gets or sets the annotation height.

    public double AnnotationHeight { get; set; }

Property Value

Double
The height of the annotation drawn on the page.

Exceptions

ArgumentOutOfRangeException
Thrown when Height is set to a value less than 0.

Remarks

The value of this property represents either a percentage (0 to 100) or an absolute value based on the value of PDFFlowAnnotationContent.SizeIsRelativeToAvailableSpace property.

### AnnotationWidth

Gets or sets the annotation width.

    public double AnnotationWidth { get; set; }

Property Value

Double
The width of the annotation drawn on the page.

Exceptions

ArgumentOutOfRangeException
Thrown when Width is set to a value less than 0.

Remarks

The value of this property represents either a percentage (0 to 100) or an absolute value based on the value of PDFFlowAnnotationContent.SizeIsRelativeToAvailableSpace property.

### Background

Gets or sets the content background.

    public PDFBrush Background { get; set; }

Property Value

PDFBrush
The background of the flow content.

Remarks

The background that fills the flow content bounding rectangle.

### DestinationName

Gets or sets the destination name.

    public string DestinationName { get; set; }

Property Value

String
The name of the destination created at the location of the flow content.

Remarks

A named destination is created at the top of flow content when this property is not null or an empty string.

### HorizontalAlign

Gets or sets the horizontal align.

    public PDFGraphicAlign HorizontalAlign { get; set; }

Property Value

PDFGraphicAlign
The annotation alignment on horizontal relative to available space.

### InnerMargins

Gets or sets the content inner margins.

    public PDFFlowContentMargins InnerMargins { get; set; }

Property Value

PDFFlowContentMargins
A PDFFlowContentMargins object specifying the content inner margins.

Remarks

The inner margins are located inside the content's bounding rectangle. The margins are applied to content as a whole and not to parts of content when content is split across pages.

### OuterMargins

Gets or sets the content outer margins.

    public PDFFlowContentMargins OuterMargins { get; set; }

Property Value

PDFFlowContentMargins
A PDFFlowContentMargins object specifying the content outer margins.

Remarks

The outer margins are located outside the content's bounding rectangle. The margins are applied to content as a whole and not to parts of content when content is split across pages.

### SizeIsRelativeToAvailableSpace

Gets or sets a value indicating how the annotation size is interpreted.

    public bool SizeIsRelativeToAvailableSpace { get; set; }

Property Value

Boolean
True if the annotation size (PDFFlowAnnotationContent.AnnotationWidth, PDFFlowAnnotationContent.AnnotationHeight properties) is a percentage of the available space, false is the annotation size is given in absolute values.

### StructureElement

Gets or sets the structure element.

    public PDFStructureElement StructureElement { get; set; }

Property Value

PDFStructureElement
The PDFStructureElement object associated with this flow content object.

### Tag

Gets or sets an arbitrary object value that can be used to store custom information about this element.

    public object Tag { get; set; }

Property Value

Object
The intended value.

Remarks

This property is analogous to Tag properties in other Microsoft programming models. Tag is intended to provide a pre-existing property location where you can store some basic custom information about any PDFFlowContent without requiring you to subclass a content object.

### VerticalAlign

Gets or sets the vertical align.

    public PDFGraphicAlign VerticalAlign { get; set; }

Property Value

PDFGraphicAlign
The annotation alignment on vertical relative to available space.

## Methods

### GetContentHeight(Double)

Gets the content height.

    public double GetContentHeight(double width)

Parameters

`width` Double
The width for which the content height is computed.

Returns

Double
The height of the content for the specified width.

## Events

### AfterContentDraw

Gets or sets the event that is fired after the flow content object is drawn on the page.

    public event EventHandler<PDFFlowContentDrawEventArgs> AfterContentDraw;

### BeforeContentDraw

Gets or sets the event that is fired before the flow content object is drawn on the page.

    public event EventHandler<PDFFlowContentDrawEventArgs> BeforeContentDraw;