public class TemplateLinkedPosition extends TemplatePosition
The following example shows the code for the situation if it's known that the field with an invoice number is placed on the right of "Invoice number" string the following code is used:
// Create a regex template field to find "Invoice Number" text
TemplateField invoice = new TemplateField(new TemplateRegexPosition("Invoice Number"), "Invoice");
// Create a related template field associated with "Invoice" field and extract the value on the right of it
TemplateField invoiceNumber = new TemplateField(
new TemplateLinkedPosition("invoice", new Size(100, 15), new TemplateLinkedPositionEdges(false, false, true, false)),
"InvoiceNumber");
Constructor and Description |
---|
TemplateLinkedPosition(String linkedFieldName,
Size searchArea,
TemplateLinkedPositionEdges edges)
Initializes a new instance of the
TemplateLinkedPosition class. |
TemplateLinkedPosition(String linkedFieldName,
Size searchArea,
TemplateLinkedPositionEdges edges,
boolean autoScale)
Initializes a new instance of the
TemplateLinkedPosition class. |
Modifier and Type | Method and Description |
---|---|
TemplateLinkedPositionEdges |
getEdges()
Gets the edges of the linked field where a field is searched.
|
String |
getLinkedFieldName()
Gets the linked field name.
|
Size |
getSearchArea()
Gets the size of the area where a field is searched.
|
Boolean |
isAutoScale()
Gets the value that indicates whether
SearchArea is scaled by the linked field size. |
public TemplateLinkedPosition(String linkedFieldName, Size searchArea, TemplateLinkedPositionEdges edges)
TemplateLinkedPosition
class.linkedFieldName
- The name of the linked field.searchArea
- The size of the area where a field is searched.edges
- The edges of the linked field where a field is searched.public TemplateLinkedPosition(String linkedFieldName, Size searchArea, TemplateLinkedPositionEdges edges, boolean autoScale)
TemplateLinkedPosition
class.linkedFieldName
- The name of the linked field.searchArea
- The size of the area where a field is searched.edges
- The edges of the linked field where a field is searched.autoScale
- The value that indicates whether searchArea is scaled by the linked field size.public String getLinkedFieldName()
public Size getSearchArea()
Size
class that represents the size of the area where a field is searched.public Boolean isAutoScale()
SearchArea
is scaled by the linked field size.SearchArea
is scaled by the linked field size; otherwise, false
.public TemplateLinkedPositionEdges getEdges()
TemplateLinkedPositionEdges
class that represents the edges of the linked field where a field is searched.