Documentation
¶
Overview ¶
Package table finds ruled tables on a PDF page: tables whose cells are drawn with lines or rectangles. It is a port of pdfplumber's TableFinder with its default settings (the "lines" strategy for both axes), after Anssi Nurminen's thesis and Tabula: edges from the page's lines, rectangles and curves are snapped and joined, their intersections give cells, and cells sharing corners form tables.
It deliberately does not port pdfplumber's "text" strategy, which guesses columns from word alignment: a table only comes from lines actually drawn on the page.
Coordinates here are pdfplumber's: page-relative, y growing downward.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractText ¶
ExtractText is pdfplumber's extract_text with default settings: chars grouped into words, words into lines, lines joined with newlines.
Types ¶
type Table ¶
type Table struct {
BBox BBox
Rows [][]*string
// Cells holds each cell's characters, parallel to Rows, for callers
// that assemble cell text their own way.
Cells [][][]Char
// Chars counts the characters in the table's cells; Rotated, those not
// upright; Overflow, those reaching more than a point past their
// cell's left or right side, as text running across ruled lines does.
// They help judge whether a grid reads as a table.
Chars, Rotated, Overflow int
}
Table is a found table: its box, and its rows of cells. A nil cell is a position no cell covers (part of a merged cell).