public class TemplateTable extends TemplateItem
There are two ways to define a table:
TemplateTableLayout
class. In this case the table is defined by its position on the page:
rectangular area, columns and rows separators.TemplateTableParameters
class. In this case the table is detected automatically
by algorithms with set parameters. See TemplateTableParameters
class for more information.Constructor and Description |
---|
TemplateTable(TemplateTableLayout layout,
String name,
Integer pageIndex)
Initializes a new instance of the
TemplateTable class. |
TemplateTable(TemplateTableParameters parameters,
String name,
Integer pageIndex)
Initializes a new instance of the
TemplateTable class. |
Modifier and Type | Method and Description |
---|---|
TemplateTableLayout |
getLayout()
Gets the table layout.
|
TemplateTableParameters |
getParameters()
Gets the parameters to detect the table in the automatic mode.
|
getName, getPageIndex
public TemplateTable(TemplateTableLayout layout, String name, Integer pageIndex)
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 }));
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.public TemplateTable(TemplateTableParameters parameters, String name, Integer pageIndex)
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
- 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.public TemplateTableLayout getLayout()
TemplateTableLayout
class that represents the table layout; null
if it isn't set.public TemplateTableParameters getParameters()
TemplateTableParameters
class that represents the parameters to detect the table in the automatic mode; null
if it isn't set.