__init__ constructor
Leave feedback
On this page
Initializes a new PageTextAreaOptions instance with the OCR usage option.
def __init__(self):
...
Initializes a new instance of the PageTextAreaOptions class with the OCR usage option.
def __init__(self, use_ocr):
...
| Parameter | Type | Description |
|---|---|---|
| use_ocr | bool |
The value that indicates whether OCR functionality is used to extract text areas. |
Initializes a new instance of the PageTextAreaOptions class with the ability to set OCR options.
def __init__(self, use_ocr, ocr_options):
...
| Parameter | Type | Description |
|---|---|---|
| use_ocr | bool |
The value that indicates whether OCR functionality is used to extract text areas. |
| ocr_options | OcrOptions |
The additional options for OCR functionality. |
Initializes a new PageTextAreaOptions instance with the regular expression.
The following properties have default values:
PageTextAreaOptions.MatchCase: FalsePageTextAreaOptions.UniteSegments: FalsePageTextAreaOptions.IgnoreFormatting: FalsePageAreaOptions.Rectangle: None
def __init__(self, expression):
...
| Parameter | Type | Description |
|---|---|---|
| expression | str |
The regular expression. |
from groupdocs.parser.options import PageTextAreaOptions
options = PageTextAreaOptions(expression=r"\d{4}-\d{2}-\d{2}")
Initializes a new PageTextAreaOptions instance with the regular expression and rectangular area, leaving other options at their default values.
By default, MatchCase, UniteSegments, and IgnoreFormatting are set to False.
def __init__(self, expression, rectangle):
...
| Parameter | Type | Description |
|---|---|---|
| expression | str |
The regular expression. |
| rectangle | Rectangle |
The rectangular area that contains page areas. |
from groupdocs.parser.options import PageTextAreaOptions
from groupdocs.parser.data import Rectangle, Point, Size
rect = Rectangle(Point(0, 0), Size(200, 100))
options = PageTextAreaOptions(r"\w+", rect)
Initializes a new instance of the PageTextAreaOptions class with the regular expression, rectangular area and the size of the ignored border.
def __init__(self, expression, rectangle, rectangle_tolerance):
...
| Parameter | Type | Description |
|---|---|---|
| expression | str |
The regular expression. |
| rectangle | Rectangle |
The rectangular area that contains page areas. |
| rectangle_tolerance | float |
The size of the border that is ignored when captured by the rectangular area. Measured as a fraction of a text item height. |
from groupdocs.parser.options import PageTextAreaOptions
from groupdocs.parser.data import Rectangle
options = PageTextAreaOptions(
expression=r"\d+",
rectangle=Rectangle(0, 0, 100, 200),
rectangle_tolerance=0.1
)
Initializes a new PageTextAreaOptions instance.
def __init__(self, expression, match_case, unite_segments, ignore_formatting, rectangle):
...
| Parameter | Type | Description |
|---|---|---|
| expression | str |
The regular expression. |
| match_case | bool |
Indicates whether text case is considered. |
| unite_segments | bool |
Indicates whether segments are united. |
| ignore_formatting | bool |
Indicates whether text formatting is ignored. |
| rectangle | Rectangle |
The rectangular area that contains page areas. |
from groupdocs.parser.options import PageTextAreaOptions
from groupdocs.parser.data import Rectangle, Point, Size
# Define a rectangular region (x=0, y=0, width=200, height=100)
rect = Rectangle(Point(0, 0), Size(200, 100))
options = PageTextAreaOptions(
expression=r"\d{4}-\d{2}-\d{2}",
match_case=True,
unite_segments=False,
ignore_formatting=False,
rectangle=rect,
)
Initializes a new PageTextAreaOptions instance with the size of the ignored border.
def __init__(self, expression, match_case, unite_segments, ignore_formatting, rectangle, rectangle_tolerance):
...
| Parameter | Type | Description |
|---|---|---|
| expression | str |
The regular expression. |
| match_case | bool |
Indicates whether text case is considered. |
| unite_segments | bool |
Indicates whether segments are united. |
| ignore_formatting | bool |
Indicates whether text formatting is ignored. |
| rectangle | Rectangle |
The rectangular area that contains page areas. |
| rectangle_tolerance | float |
The size of the border that is ignored when captured by the rectangular area. Measured as a fraction of a text item height. |
from groupdocs.parser.options import PageTextAreaOptions
from groupdocs.parser.data import Rectangle
options = PageTextAreaOptions(
expression=r"\d+",
match_case=True,
unite_segments=False,
ignore_formatting=False,
rectangle=Rectangle(0, 0, 100, 200),
rectangle_tolerance=0.05,
)
- class
PageTextAreaOptions
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.