com.groupdocs.parser.templates

Class TemplateTableParameters



  • public class TemplateTableParameters
    extends Object
    Provides parameters for the table detection algorithms.

    There are two algorithms to detect a table:

    • Allows to detect a table in the rectangular area with set columns. This algorithm is useful for simple tables (without merged columns) and provides more accurate detection.
    • Allows to detect a table in any place on the page. This is a more complex algorithm. It can detect tables in any place on the page. Additional parameters help to detect a table more correctly.

    In some cases when algorithms can't detect a table or do it in non-accurate way TemplateTableLayout class is used.

    • Constructor Detail

      • TemplateTableParameters

        public TemplateTableParameters(Rectangle rectangle,
                               Iterable<Double> verticalSeparators)
        Initializes a new instance of the TemplateTableParameters class.
        Parameters:
        rectangle - The rectangular area that contains the table.
        verticalSeparators - The table columns separators.
      • TemplateTableParameters

        public TemplateTableParameters(Rectangle rectangle,
                               Iterable<Double> verticalSeparators,
                               Boolean mergedCells,
                               Integer minRowCount,
                               Integer minColumnCount,
                               Integer minVerticalSpace)
        Initializes a new instance of the TemplateTableParameters class.
        Parameters:
        rectangle - The rectangular area that contains the table.
        verticalSeparators - The table columns separators.
        mergedCells - The value that indicates whether the table has merged cells.
        minRowCount - The minimum number of the table rows.
        minColumnCount - The minumum number of the table columns.
        minVerticalSpace - The minumum space between the table columns.
    • Method Detail

      • getRectangle

        public Rectangle getRectangle()
        Gets the rectangular area that contains the table.
        Returns:
        An instance of Rectangle class that represents the rectangular area that contains the table; null if it isn't set.
      • getVerticalSeparators

        public List<Double> getVerticalSeparators()
        Gets the table columns separators.
        Returns:
        A collection of double values that represent x-coordinates of the table columns separators; null if it isn't set.
      • hasMergedCells

        public Boolean hasMergedCells()
        Gets the value that indicates whether the table has merged cells.
        Returns:
        true if the table has merged cells; otherwise, false. null if it isn't set.
      • getMinRowCount

        public Integer getMinRowCount()
        Gets the minimum number of the table rows.
        Returns:
        An integer value that represents the minimum number of the table rows; null if it isn't set.
      • getMinColumnCount

        public Integer getMinColumnCount()
        Gets the minimum number of the table columns.
        Returns:
        An integer value that represents the minimum number of the table columns; null if it isn't set.
      • getMinVerticalSpace

        public Integer getMinVerticalSpace()
        Gets the minumum space between the table columns.
        Returns:
        An integer value that represents the minumum space between the table columns; null if it isn't set.