PdfTableExtractor Class

Rebuilds a ruled table from a region of a page: the horizontal and vertical rules the page paints in the region make the grid, and the words of the text (PdfPage.ExtractTextLayout) fill its cells. When the table cannot be rebuilt, the result tells why (PdfTableExtractionFailureKind) instead of returning a wrong table.

public static class PdfTableExtractor

Remarks

The rules are the segments of the stroked paths, the edges of their rectangles included, and the thin filled rectangles. A rule must cross the region to be a line of the grid: the outer border of the table is part of the grid. A word belongs to the cell its center is in.

Methods

NameDescription
Extract(PdfPage, PdfRectangle, PdfTableExtractionOptions?)Rebuilds the table of a region of a page.

Extract(PdfPage, PdfRectangle, PdfTableExtractionOptions?)

PdfTableExtractor.cs

Rebuilds the table of a region of a page.

public static PdfTableExtractionResult Extract(PdfPage page, PdfRectangle region, PdfTableExtractionOptions? options = null)

Parameters

page PdfPage
The page.
region PdfRectangle
The region of the table, in default user space: the grid is looked for in it.
options PdfTableExtractionOptions?
The options, or null for PdfTableExtractionOptions.Default.

Returns

PdfTableExtractionResult The table, or the reason why it could not be rebuilt.

Exceptions

PdfException
The content of the page cannot be read.