Skip to content

PDFFlowTableContent

Namespace: O2S.Components.PDF4NET.FlowDocument

Defines a table that can be added to a flow document.

public class PDFFlowTableContent : PDFFlowContent

Inheritance ObjectPDFFlowContentPDFFlowTableContent

Constructors

PDFFlowTableContent(Int32)

Initializes a new PDFFlowTableContent object with the specified number of columns.

public PDFFlowTableContent(int columnCount)

Parameters

columnCount Int32
The number of columns in the table.

Exceptions

ArgumentOutOfRangeException
Thrown when columnCount is less than or equal to zero.


PDFFlowTableContent(PDFFlowTableColumn[])

Initializes a new PDFFlowTableContent object with the specified columns.

public PDFFlowTableContent(PDFFlowTableColumn[] columns)

Parameters

columns PDFFlowTableColumn[]
The array of columns in the table.

Exceptions

ArgumentNullException
Thrown when columns is null.


Properties

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.


Border

Gets or sets the table border.

public PDFPen Border { get; set; }

Property Value

PDFPen
A PDFPen object that describes how the table border is drawn.


Columns

Gets the table columns.

public PDFFlowTableColumn[] Columns { get; internal set; }

Property Value

PDFFlowTableColumn[]
The list of columns in the table.


DefaultCell

Gets or sets the default cell model.

public PDFFlowTableCell DefaultCell { get; set; }

Property Value

PDFFlowTableCell
A cell object that serves as model for cells created by PDFFlowTableContent.CreateCell(Object) method.


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.


HeaderRows

Gets the header rows.

public PDFFlowTableRowCollection HeaderRows { get; }

Property Value

PDFFlowTableRowCollection
The collection of rows in the table header.


HorizontalAlign

Gets or sets the horizontal align.

public PDFGraphicAlign HorizontalAlign { get; set; }

Property Value

PDFGraphicAlign
The table 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.


MaxRowHeight

Maximum height for table rows.

public double MaxRowHeight { get; set; }

Property Value

Double
The maximum height for the rows in the table.

Remarks

If the height of row content exceeds this value, the content will be clipped.


MinRowHeight

Minimum height for table rows.

public double MinRowHeight { get; set; }

Property Value

Double
The minimum height for the rows in the table.


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.


Rows

Gets the table rows.

public PDFFlowTableRowCollection Rows { get; }

Property Value

PDFFlowTableRowCollection
The collection of rows in the table.


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.


Methods

CreateCell(Object)

Creates a new cell based on the PDFFlowTableContent.DefaultCell property.

public PDFFlowTableCell CreateCell(object cellContent)

Parameters

cellContent Object
The cell content, it depends on the cell being created. If the cell is a string cell, then the object is converted to string and set as cell content.

Returns

PDFFlowTableCell
A new cell object with the properties set by default to the values defined by the PDFFlowTableContent.DefaultCell object.


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

AfterCellDraw

Gets or sets the event that is fired after a cell object is drawn on the page.

public event EventHandler<PDFFlowTableCellDrawEventArgs> AfterCellDraw;

AfterContentDraw

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

public event EventHandler<PDFFlowContentDrawEventArgs> AfterContentDraw;

BeforeCellDraw

Gets or sets the event that is fired before a cell object is drawn on the page.

public event EventHandler<PDFFlowTableCellDrawEventArgs> BeforeCellDraw;

BeforeContentDraw

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

public event EventHandler<PDFFlowContentDrawEventArgs> BeforeContentDraw;