PdfElixide.Document.Table.Row (pdf_elixide v0.9.0)

Copy Markdown View Source

A single row of a detected table, holding its cells.

A row is enumerable over the cells it stores:

Enum.map(row, & &1.text)
#=> ["Age", "0.042", "0.011", "0.001"]

cell/2 and cell_text/2 reach the same cells by position, so they agree with Enum.at/2. A row whose detection merged cells stores fewer cells than the table's :col_count — see PdfElixide.Document.Table for what that means for indices.

Summary

Functions

The cell at the zero-based position col, or nil when the row does not reach that far.

The text of the cell at the zero-based position col, or nil when the row does not reach that far.

Types

t()

@type t() :: %PdfElixide.Document.Table.Row{
  cells: [PdfElixide.Document.Table.Cell.t()],
  header?: boolean()
}

Functions

cell(row, col)

@spec cell(t(), non_neg_integer()) :: PdfElixide.Document.Table.Cell.t() | nil

The cell at the zero-based position col, or nil when the row does not reach that far.

Row.cell(row, 0)
#=> #PdfElixide.Document.Table.Cell<"Age">

cell_text(row, col)

@spec cell_text(t(), non_neg_integer()) :: String.t() | nil

The text of the cell at the zero-based position col, or nil when the row does not reach that far.

Row.cell_text(row, 0)
#=> "Age"