Extracts data in a rectangular region, defined in inches. The region extracts lines contained inside the region (for the definition of "contained", see the Parameters section).

In general, use this method:

  • for faster performance compared to the Box method
  • when you want to extract data from an area whose formatting doesn't fit other SenseML methods. For example, you can use this method instead of the Label method for widely separated anchors and target lines.

Parameters
Examples
Notes

Parameters

Note: For the full list of parameters available for this method, see Global parameters for methods. The following table shows parameters most relevant to or specific to this method.

idvaluedescription
id (required)regionExtracts lines contained in the region, where "contained" means:
- the region and the line overlap for at least 90% of either the region or the line's width ("x extent").
AND
- the region and the line overlap for at least 90% of either the region or the line's y height ("extent").
start (required)above, below, left, rightDefines the starting point for the extraction region relative to the anchor. For example, right specifies starting at the midpoint of the anchor line's right boundary, and below specifies starting at the midpoint of the anchor line's bottom boundary.
offsetX (required)numberThe horizontal offset in inches from the point defined in the Start parameter to the top left corner of the region.
You can visually determine this number in the Sensible app by changing the number and watching the green region box resize.
offsetY (required)numberThe vertical offset in inches from the point defined in the Start parameter to the top left corner of the region.
You can visually determine this number in the Sensible app by changing the number and watching the green region box resize.
width (required)numberThe width in inches of the region. 
You can visually determine this number in the Sensible app by changing the number and watching the green region box resize.
height (required)numberThe height in inches of the region. 
You can visually determine this number in the Sensible app by changing the number and watching the green region box resize.
isAbsoluteOffsetboolean. default: falseMakes the offsets relative to the 0,0 origin at the top left of the page rather than to the Start parameter.

Examples

The following example shows extracting a social security number from a W-9 form by defining a region to extract.

Config

{
  "fields": [
    {
      "id": "SSN",
      "anchor": {
        "match": {
          "type": "equals",
          "text": "Social security number",
          "isCaseSensitive": true
        }
      },
      "method": {
        "id": "region",
        "start": "below",
        "width": 2.15,
        "height": 0.25,
        "offsetX": -0.55,
        "offsetY": 0.1
      }
    }
  ]
}

Example document
The following image shows the example PDF used with this example config:

Click to enlargeClick to enlarge

Example PDFDownload link

Output

{
  "SSN": {
    "type": "string",
    "value": "1 2 3 4 5 7 8 9 3 – –"
  }
}

Notes

If the region that you want to extract is a box that's bordered with dark lines, you can use the Box method instead of the Region method.


Did this page help you?