TemplateField
Leave feedback
On this page
Inheritance: java.lang.Object, com.groupdocs.parser.templates.TemplateItem
public class TemplateField extends TemplateItem
Provides the template text field.
Text fields are defined by its position on the page. There are three ways to define a text field:
- Using the rectangular area: TemplateFixedPosition
- Using the regular expression: TemplateRegexPosition
- Using the linked field: TemplateLinkedPosition
| Constructor | Description |
|---|---|
| TemplateField(TemplatePosition position, String name) | Initializes a new instance of the TemplateField class. |
| TemplateField(TemplatePosition position, String name, Integer pageIndex) | Initializes a new instance of the TemplateField class with the UPPER CASE name. |
| TemplateField(TemplatePosition position, String name, Integer pageIndex, Double pageWidth) | Initializes a new instance of the TemplateField class with the UPPER CASE name. |
| TemplateField(TemplatePosition position, String name, Integer pageIndex, boolean useUpperCaseName) | Initializes a new instance of the TemplateField class. |
| TemplateField(TemplatePosition position, String name, Integer pageIndex, Double pageWidth, boolean useUpperCaseName) | Initializes a new instance of the TemplateField class. |
| Method | Description |
|---|---|
| getPosition() | Gets the value that describes how to find the template field on the document page. |
| scale(double factor) |
public TemplateField(TemplatePosition position, String name)
Initializes a new instance of the TemplateField class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| position | TemplatePosition | The field position. |
| name | java.lang.String | The field name. |
public TemplateField(TemplatePosition position, String name, Integer pageIndex)
Initializes a new instance of the TemplateField class with the UPPER CASE name.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| position | TemplatePosition | The field position. |
| name | java.lang.String | The field name. |
| pageIndex | java.lang.Integer | An integer value that represents the index of the page where the template item is located; null if the template item is located on any page. |
public TemplateField(TemplatePosition position, String name, Integer pageIndex, Double pageWidth)
Initializes a new instance of the TemplateField class with the UPPER CASE name.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| position | TemplatePosition | The field position. |
| name | java.lang.String | The field name. |
| pageIndex | java.lang.Integer | An integer value that represents the index of the page where the template item is located; null if the template item is located on any page. |
| pageWidth | java.lang.Double | The width of the page that was used to create the template item. |
public TemplateField(TemplatePosition position, String name, Integer pageIndex, boolean useUpperCaseName)
Initializes a new instance of the TemplateField class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| position | TemplatePosition | The field position. |
| name | java.lang.String | The field name. |
| pageIndex | java.lang.Integer | An integer value that represents the index of the page where the template item is located; null if the template item is located on any page. |
| useUpperCaseName | boolean | The value that indicates whether a name is converted to UPPER CASE. |
TemplateField(TemplatePosition position, String name, Integer pageIndex, Double pageWidth, boolean useUpperCaseName)
public TemplateField(TemplatePosition position, String name, Integer pageIndex, Double pageWidth, boolean useUpperCaseName)
Initializes a new instance of the TemplateField class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| position | TemplatePosition | The field position. |
| name | java.lang.String | The field name. |
| pageIndex | java.lang.Integer | An integer value that represents the index of the page where the template item is located; null if the template item is located on any page. |
| pageWidth | java.lang.Double | The width of the page that was used to create the template item. |
| useUpperCaseName | boolean | The value that indicates whether a name is converted to UPPER CASE. |
public TemplatePosition getPosition()
Gets the value that describes how to find the template field on the document page.
Returns: TemplatePosition - An instance of TemplatePosition descendant class.
public TemplateItem scale(double factor)
Creates a copy of the current item with all coordinates scaled by the given factor.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| factor | double |
Returns: TemplateItem
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.