Parse an Order Form using Document Parser

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

In this step-by-step tutorial with screenshots, you will learn how to parse an order form with line items and total using Document Parser.

We have this sample order form that we’re going to use for this tutorial:

Screenshot of Sample Order Form
Screenshot of Sample Order Form

First, go to your dashboard by logging in to your PDF.co account.

Step 1 – Go to PDF.co Document Parser

  • Click on the Document Parser menu at the top of your dashboard

Go to PDF.co Document Parser

Step 2 – Create a New Template

  • To create a new template. Click new template

Create a New Template

Step 3 – Load Source PDF or Image

  • Load the source PDF or image that you’re going to use

Load Source PDF or Image

Step 4 – Add Objects

  • To get the Line Items, choose Add TABLE field based on TEXT SEARCH
  • To get the Total, choose Add FIELD based on TEXT SEARCH

Add table field based on text search object

Add field based on text search object

Step 5 – Add Properties and Expression

  • To get the Total with the object Add FIELD based on TEXT SEARCH. Set the Expression to Total{{Anything}}(?<value>{{Number}}).Make sure to check the Regex check box and change the DataType to Decimal or Currency.
  • To get the Line Items with the object Add TABLE field based on TEXT SEARCH. Set the Properties to:
    • {
      "start": {
      "expression": "({{LineStart}})(?=Order #:)",
      "regex": true
      },
      "end": {
      "expression": "Total Order Amount",
      "regex": true
      },
      "introduction": {
      "expression": "{{ToggleSingleLineMode}}Order #:{{Spaces}}(?<OrderNo>{{Digits}}){{Anything}}Site:{{Spaces}}(?<Site>{{SentenceWithSingleSpaces}}){{Anything}}Date:{{Spaces}}(?<Date>{{SmartDate}})",
      "regex": true
      },
      "row": {
      "expression": "{{LineStart}}{{Spaces}}(?<Quantity>{{Digits}}){{Spaces}}(?<ItemNo>{{Digits}}){{Spaces}}(?<ItemName>{{SentenceWithSingleSpaces}}){{Spaces}}(?<Price>{{Number}}){{Spaces}}(?<LineTotal>{{Number}}){{LineEnd}}",
      "regex": true
      },
      "columns": [
      {
      "name": "Date",
      "dataType": "date",
      "dateFormat": "auto-YMD"
      },
      {
      "name": "Quantity",
      "dataType": "integer"
      },
      {
      "name": "Price",
      "dataType": "decimal"
      },
      {
      "name": "LineTotal",
      "dataType": "decimal"
      }
      ]
      }

Adding expression

Adding properties

Step 6 – Run Template

  • Once you’re done adding the necessary objects for your template. It’s now time to run it

Run template

Step 7 – Result

  • Here’s the result
Parsed data of the Order Form
Parsed data of the Order Form

Step 8 – Save Template

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

Save template

You learned how to parse an order form with line items and total through this tutorial.

Parse an Order Form – Video