Quick Start with the Document Parser Template Editor: How to Create a Template
In this tutorial, you will learn how to create a reusable Document Parser template with the PDF.co Online Template Editor. The template will extract individual fields, multiline text, a fixed table, values found through text searches, and predefined static values.
You can follow along using the sample invoice PDF.

Open the Template Editor
- Sign in to your PDF.co account.
- Open the Document Parser Template Editor.
- Create a new template.
- Load the sample invoice or another representative document.
For reliable results, build and test the template with documents that have the same general structure as the files you plan to process.

Extract a One-Line Field
We will begin by extracting the invoice number.
- Click Add Object.
- Select Field from Rectangle Selection.
- Draw the rectangle around the complete invoice number.
- Give the object a descriptive name, such as
invoiceNumber. - Click Test Object and confirm that only the invoice number is returned.
Resize the rectangle if it captures surrounding labels or unrelated text.
Extract the Invoice Date
Add another Field from Rectangle Selection object and place it over the invoice date.
Configure the object as follows:
- Name:
invoiceDate - Data Type:
Date - Rectangle: Cover the complete date without including nearby text.
Test the object and verify that the date is returned in the expected format.
Extract Multiline Text
The invoice address contains multiple lines but can still be extracted with one rectangle object.
- Add another Field from Rectangle Selection object.
- Draw the rectangle around the entire address.
- Name the object
invoiceAddress. - Test the object and confirm that all address lines are included.
The rectangle should be large enough to include the complete address but should not overlap unrelated content.
Extract a Fixed Table
Use a rectangle-based table object when the table remains in approximately the same location and has a consistent structure.
- Click Add Object.
- Select Table from Rectangle.
- Draw a rectangle around the entire table, including all required rows and columns.
- Give the object a descriptive name, such as
invoiceItems. - Click Test Object.
- Review the extracted rows and columns and adjust the rectangle if necessary.
This approach is best suited to a fixed, single-page table. Documents with tables that move or continue across pages may require a search-based or automatically detected table object instead.
Extract Values Using Text Search
A search-based field can locate values even when their positions vary between documents.
Extract the Subtotal
- Click Add Object.
- Select Field based on Text Search.
- Name the object
subtotal. - In Expression, enter:
SUBTOTAL{{Spaces}}{{Money}} - Enable the expression or regular-expression option required by the editor.
- Set Data Type to
DecimalorCurrency. - Click Test Object and verify that the subtotal is returned.
The {{Spaces}} macro matches one or more spaces, while {{Money}} matches a monetary value.
Extract the Sales Tax
Create another Field based on Text Search object with the following expression:
SALES TAX{{Spaces}}{{Money}}
Name the object salesTax, select the appropriate numeric data type, and test the result.
Extract the Total
Create another search-based field with this expression:
TOTAL DUE BY DATE{{Spaces}}{{Money}}
Name the object totalDue, configure its data type, and test the result.
If an expression does not return the expected value, check the document’s capitalization, spacing, and wording. You can also use case-insensitive matching or adjust the expression as needed.
Add Static Values
A Field with Static Value returns predefined information that does not need to be extracted from the source document.
Add the Currency
- Click Add Object.
- Select Field with Static Value.
- Set the object name to
currency. - Enter
USDas the value. - Test the object.
Add the Company Name
Add another Field with Static Value object:
- Name:
companyName - Value:
ACME Inc.
Static values are useful for adding a vendor name, currency, template identifier, document category, or other known information to every extraction result.
Test the Complete Template
After configuring all objects:
- Give the template a descriptive name.
- Click Run Template to process the sample document.
- Review the complete output.
- Confirm that every field has a meaningful and unique name.
- Verify the values, data types, table rows, and static information.
- Correct and retest any object that returns incomplete or incorrect data.
Whenever possible, test the template with several representative documents rather than relying on only one sample.
Save the Template
Once the results are correct, save the template to the PDF.co Document Parser Template Manager. You can also export the template to a file for backup or reuse.
The saved template can then be selected by its template ID when using the PDF.co Document Parser API or supported automation integrations.
You have created a reusable Document Parser template that extracts fixed-position fields, multiline text, table data, search-based monetary values, and static information. You also learned how to test individual objects and validate the complete extraction result before saving the template.
For additional object types, macros, expressions, and advanced table options, see the PDF.co Document Parser Template Creation Guide.
Related Tutorials

