Step by step guide
This guide is made for borderless table. The template in this tutorial is based on the table image below. You can get the template here.
1. First, create a new Document Parser template using the Online Template Editor.
2. Next, click the Load Test PDF or Image button and select your source file.
3. Then, click the +Add Objects button.
4. Select Add TABLE field based on TEXT SEARCH.
5. Click on the Edit Template button and look for the table object.
6. Replace the tableProperties with the following:
"tableProperties": {
"start": {
"expression": "Product Code{{Spaces}}Item Name",
"regex": true
},
"end": {
"expression": "Total",
"regex": true
},
"row": {
"expression": "{{LineStart}}{{Spaces}}(?<code>{{UppercaseLettersOrDigits}}){{Spaces}}(?<item>{{SentenceWithSingleSpaces}}){{Spaces}}(?<options>{{SentenceWithSingleSpaces}}){{Spaces}}(?<qty>{{Number}}){{Spaces}}{{Dollar}}(?<price>{{Number}}){{Spaces}}{{Dollar}}(?<subtotal>{{Number}})",
"subExpression1": "{{LineStart}}{{Spaces}}(?<item>{{SentenceWithSingleSpaces}}){{Spaces}}(?<options>{{SentenceWithSingleSpaces}}{{LineEnd}})",
"subExpression2": "{{LineStart}}{{Spaces}}(?<options>{{SentenceWithSingleSpaces}}{{LineEnd}})",
"regex": true
},
"columns": [
{
"name": "code",
"dataType": "string"
},
{
"name": "item",
"dataType": "string"
},
{
"name": "options",
"dataType": "string"
},
{
"name": "qty",
"dataType": "integer"
},
{
"name": "price",
"dataType": "decimal"
},
{
"name": "subtotal",
"dataType": "decimal"
}
],
"multipage": true
}
7. Run the template and output will look like below.