Parse Invoice Table with Empty Columns

  1. Go to your PDF.co Document Parser
  2. Create a New Template
  3. Load Test PDF or Image
  4. Add Objects
  5. Set Object Expression and Properties
  6. Run Template
  7. Result
  8. Save Template

Through this step-by-step tutorial with screenshots, you will learn how to parse invoice tables with some empty columns using PDF.co’s Document Parser.

We prepared a sample invoice that we’re going to use for this tutorial:

Screenshot of Source Invoice
Screenshot of Source Invoice

You must first log in to your PDF.co account here.

Step 1 – Go to your PDF.co Document Parser

  • On your PDF.co dashboard, click the document parser menu to go to your PDF.co document parser page

Go to your PDF.co Document Parser

Step 2 – Create a New Template

  • To create a new template. Simply click the New Template link on your document parser page

Create a New Template

Step 3 – Load Test PDF or Image

  • Load your test PDF or image to start creating your template

Load Test PDF or Image

Step 4 – Add Objects

  • To get the Due Date, Customer Number, and Customer Name. Use the Add FIELD based on TEXT SEARCH object
  • To get Table Value, use the Add TABLE field based on TEXT SEARCH object

Add field based on text search object

Add table field based on text search

Step 5 – Set Object Expression and Properties

  • To get the Due Date of your invoice. Set the Expression to Payment Due(?<value>{{SmartDate}})
  • To get the Customer Number. Set the Expression to Customer Number(?<value>{{LettersOrDigits}})
  • To get the Customer Name. Set the Expression to Customer Name(?<value>{{SentenceWithSingleSpaces}})
  • To get the Table Value. Use the following Properties:
    • {
      "start": {
      "expression": "CODE{{Spaces}}DESCRIPTION",
      "regex": true
      },
      "end": {
      "expression": "NOTHING FOLLOWS",
      "regex": true
      },
      "columns": [
      {
      "name": "code",
      "dataType": "integer"
      },
      {
      "name": "description",
      "dataType": "string"
      },
      {
      "name": "qty",
      "dataType": "integer"
      },
      {
      "name": "price",
      "dataType": "decimal"
      },
      {
      "name": "unit",
      "dataType": "string"
      },
      {
      "name": "discount",
      "dataType": "decimal"
      },
      {
      "name": "extPrice",
      "dataType": "decimal"
      }
      ],
      "multipage": true
      }

Set the expression for due date

Set the expression for customer number

Set the expression for customer name

Set the properties for the table field

Step 6 – Run Template

  • Once you’re done adding the objects. You may now run your template

Run template

Step 7 – Result

  • Here’s the result
Screenshot of the Parsed Data
Screenshot of the Parsed Data

Step 8 – Save Template

  • After you’re done creating your template. You may now save it

Save template

With the help of this tutorial, you’ve learned how to parse invoice tables with some empty columns using PDF.co’s document parser.

Related Pages:

Related Samples: