How to parse table without borders
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.
First, create a new Document Parser template using the Online Template Editor.
Next, click the Load Test PDF or Image button and select your source file.
Then, click the +Add Objects button.
Select Add TABLE field based on TEXT SEARCH.
Click on the Edit Template button and look for the table object.
Replace the tableProperties with the following:
"tableProperties": {
"start": {
"expression": "Product CodeItem Name",
"regex": true
},
"end": {
"expression": "Total",
"regex": true
},
"row": {
"expression": "(?<code>)(?<item>)(?<options>)(?<qty>)(?<price>)(?<subtotal>)",
"subExpression1": "(?<item>)(?<options>)",
"subExpression2": "(?<options>)",
"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
}
- Run the template and output will look like below.
Copyright © 2016 - 2024 PDF.co