com.groupdocs.parser.templates

Class TemplateTable



  • public class TemplateTable
    extends TemplateItem
    Provides the template table.

    There are two ways to define a table:

    • Constructor Detail

      • TemplateTable

        public TemplateTable(TemplateTableLayout layout,
                     String name,
                     Integer pageIndex)
        Initializes a new instance of the TemplateTable class.

        Template table is set by table layout if the table can't be detected automatically:

        TemplateTableLayout layout = new TemplateTableLayout(
             java.util.Arrays.asList(new Double[] { 50.0, 95.0, 275.0 }),
             java.util.Arrays.asList(new Double[] { 325.0, 340.0, 365.0 }));
         TemplateTable table = new TemplateTable(layout, "Details", null);
         // Create a document template
         Template template = new Template(java.util.Arrays.asList(new TemplateItem[] { table }));
        Parameters:
        layout - The table layout.
        name - The table name.
        pageIndex - The index of the page where the template table is located; null if the template table is located on any page.
      • TemplateTable

        public TemplateTable(TemplateTableParameters parameters,
                     String name,
                     Integer pageIndex)
        Initializes a new instance of the TemplateTable class.

        If a template table is set by detector parameters, the table is detected automatically:

        TemplateTableParameters parameters = new TemplateTableParameters(
             new Rectangle(new Point(175, 350), new Size(400, 200)),
             java.util.Arrays.asList(new Double[] { 185.0, 370.0, 425.0, 485.0, 545.0 }));
         TemplateTable table = new TemplateTable(parameters, "Details", 0);
         // Create a document template
         Template template = new Template(java.util.Arrays.asList(new TemplateItem[] { table }));
         
        Parameters:
        parameters - The parameters to detect the table in the automatic mode.
        name - The table name.
        pageIndex - The index of the page where the template table is located; null if the template table is located on any page.
    • Method Detail

      • getParameters

        public TemplateTableParameters getParameters()
        Gets the parameters to detect the table in the automatic mode.
        Returns:
        An instance of TemplateTableParameters class that represents the parameters to detect the table in the automatic mode; null if it isn't set.