PDFTable

public class PDFTable : PDFDocumentObject, PDFJSONSerializable
extension PDFTable: Equatable

A table is a two dimensional list. It can be styled and can contain different data.

  • Styling used for drawing

    Declaration

    Swift

    public var style: PDFTableStyle
  • All cell data

    Declaration

    Swift

    public var cells: [[PDFTableCell]]
  • List of relative widths. Values are between 0.0 and 1.0 and should sum up to 1.0

    Declaration

    Swift

    public var widths: [CGFloat]
  • Padding is the distance between the cell content and its borders.

    Declaration

    Swift

    public var padding: CGFloat
  • Margin is the distance between the cell borders and other cells

    Declaration

    Swift

    public var margin: CGFloat
  • Header rows will be drawn on every page

    Declaration

    Swift

    public var showHeadersOnEveryPage: Bool
  • Count of rows and columns in this table

    Declaration

    Swift

    public private(set) var size: (rows: Int, columns: Int) { get }
  • Undocumented

    Declaration

    Swift

    public convenience init(size: (rows: Int, columns: Int) = (0, 0))
  • Undocumented

    Declaration

    Swift

    public init(rows: Int = 0, columns: Int = 0)
  • Generates cells from given data and alignments and stores the result in the instance variable cells

    Throws

    PDFError if table validation fails. See PDFTableValidator.validateTableData(::) for details

    Declaration

    Swift

    public func generateCells(data: [[Any?]], alignments: [[PDFTableCellAlignment]]) throws
  • Modify the cell style of at the position defined by row and column

    Declaration

    Swift

    @available(*, deprecated, message: "Use subscript accessor [row:column:] instead, this will be removed in release 2.1")
    public func setCellStyle(row rowIndex: Int, column columnIndex: Int, style cellStyle: PDFTableCellStyle?) throws
  • Undocumented

    Declaration

    Swift

    public var rows: PDFTableRows { get }
  • Undocumented

    Declaration

    Swift

    public var columns: PDFTableColumns { get }
  • Undocumented

    Declaration

    Swift

    public var content: [[PDFTableContentable?]] { get set }
  • Undocumented

    Declaration

    Swift

    public var alignment: [[PDFTableCellAlignment]] { get set }
  • TODO: Documentation

    Declaration

    Swift

    public static func == (lhs: PDFTable, rhs: PDFTable) -> Bool
  • Accessor for a specific cell at the given position

    Declaration

    Swift

    public subscript(position: PDFTableCellPosition) -> PDFTableCell { get set }

    Parameters

    row

    Index of row

    column

    Index of column

    Return Value

    cell at given indicies

  • Accessor for a specific cell at the given position

    Declaration

    Swift

    public subscript(row: Int, column: Int) -> PDFTableCell { get set }

    Parameters

    row

    Index of row

    column

    Index of column

    Return Value

    cell at given indicies

  • Accessor for a specific column

    Declaration

    Swift

    public subscript(column index: Int) -> PDFTableColumn { get set }

    Parameters

    column

    Index of column

    Return Value

    PDFTableColumn with references to cells of this table

  • Accessors of columns in the given range.

    Declaration

    Swift

    public subscript(columns range: ClosedRange<Int>) -> PDFTableColumns { get set }

    Parameters

    columns

    Range of indicies

    Return Value

    PDFTableColumns with references to columns

  • Accessors of columns in the given range.

    Declaration

    Swift

    public subscript(columns range: PartialRangeFrom<Int>) -> PDFTableColumns { get set }

    Parameters

    columns

    Range of indicies

    Return Value

    PDFTableColumns with references to columns

  • Accessors of columns in the given range.

    Declaration

    Swift

    public subscript(columns range: PartialRangeThrough<Int>) -> PDFTableColumns { get set }

    Parameters

    columns

    Range of indicies

    Return Value

    PDFTableColumns with references to columns

  • Accessors of columns in the given range.

    Declaration

    Swift

    public subscript(columns range: PartialRangeUpTo<Int>) -> PDFTableColumns { get set }

    Parameters

    columns

    Range of indicies

    Return Value

    PDFTableColumns with references to columns

  • Accessors of columns in the given range.

    Declaration

    Swift

    public subscript(columns range: Range<Int>) -> PDFTableColumns { get set }

    Parameters

    columns

    Range of indicies

    Return Value

    PDFTableColumns with references to columns

  • Accessor for a specific row

    Declaration

    Swift

    public subscript(row index: Int) -> PDFTableRow { get set }

    Parameters

    row

    Index of row

    Return Value

    PDFTableRow with references to cells of this table

  • Accessors of rows in the given range.

    Declaration

    Swift

    public subscript(rows range: ClosedRange<Int>) -> PDFTableRows { get set }

    Parameters

    rows

    Range of indicies

    Return Value

    PDFTableRows with references to rows

  • Accessors of rows in the given range.

    Declaration

    Swift

    public subscript(rows range: PartialRangeFrom<Int>) -> PDFTableRows { get set }

    Parameters

    rows

    Range of indicies

    Return Value

    PDFTableRows with references to rows

  • Accessors of rows in the given range.

    Declaration

    Swift

    public subscript(rows range: PartialRangeThrough<Int>) -> PDFTableRows { get set }

    Parameters

    rows

    Range of indicies

    Return Value

    PDFTableRows with references to rows

  • Accessors of rows in the given range.

    Declaration

    Swift

    public subscript(rows range: PartialRangeUpTo<Int>) -> PDFTableRows { get set }

    Parameters

    rows

    Range of indicies

    Return Value

    PDFTableRows with references to rows

  • Accessors of rows in the given range.

    Declaration

    Swift

    public subscript(rows range: Range<Int>) -> PDFTableRows { get set }

    Parameters

    rows

    Range of indicies

    Return Value

    PDFTableRows with references to rows

Single Row

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(row: Int, columns: Range<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(row: Int, columns: ClosedRange<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(row: Int, columns: PartialRangeFrom<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(row: Int, columns: PartialRangeThrough<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(row: Int, columns: PartialRangeUpTo<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

Range

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: Range<Int>, columns: ClosedRange<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: Range<Int>, columns: PartialRangeFrom<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: Range<Int>, columns: PartialRangeThrough<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: Range<Int>, columns: PartialRangeUpTo<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of column in the given rows

    Declaration

    Swift

    public subscript(rows: Range<Int>, column: Int) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    column

    Single row index

    Return Value

    PDFTableSection with references to cells

Closed Range

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: ClosedRange<Int>, columns: Range<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: ClosedRange<Int>, columns: ClosedRange<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: ClosedRange<Int>, columns: PartialRangeFrom<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: ClosedRange<Int>, columns: PartialRangeThrough<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: ClosedRange<Int>, columns: PartialRangeUpTo<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of column in the given rows

    Declaration

    Swift

    public subscript(rows: ClosedRange<Int>, column: Int) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    column

    Single row index

    Return Value

    PDFTableSection with references to cells

Partial Range From

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: PartialRangeFrom<Int>, columns: Range<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: PartialRangeFrom<Int>, columns: ClosedRange<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: PartialRangeFrom<Int>, columns: PartialRangeFrom<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: PartialRangeFrom<Int>, columns: PartialRangeThrough<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: PartialRangeFrom<Int>, columns: PartialRangeUpTo<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of column in the given rows

    Declaration

    Swift

    public subscript(rows: PartialRangeFrom<Int>, column: Int) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    column

    Single row index

    Return Value

    PDFTableSection with references to cells

Partial Range Up To

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: PartialRangeUpTo<Int>, columns: Range<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: PartialRangeUpTo<Int>, columns: ClosedRange<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: PartialRangeUpTo<Int>, columns: PartialRangeFrom<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: PartialRangeUpTo<Int>, columns: PartialRangeThrough<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: PartialRangeUpTo<Int>, columns: PartialRangeUpTo<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of column in the given rows

    Declaration

    Swift

    public subscript(rows: PartialRangeUpTo<Int>, column: Int) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    column

    Single row index

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows: Range<Int>, columns: Range<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells