ByteScout Document Parser SDK - VB.NET - Create Custom Template - ByteScout

ByteScout Document Parser SDK – VB.NET – Create Custom Template

  • Home
  • /
  • Articles
  • /
  • ByteScout Document Parser SDK – VB.NET – Create Custom Template

How to create custom template in VB.NET using ByteScout Document Parser SDK

Write code in VB.NET to create custom template with this step-by-step tutorial

Create custom template is easy to implement in VB.NET if you use these source codes below. ByteScout Document Parser SDK is the robost offline data extraction platform for template based data extraction and processing. Supports high load with millions of documents as input. Templates can be quickly created and updated with no special technical knowledge required. It can be used to create custom template using VB.NET.

This code snippet below for ByteScout Document Parser SDK works best when you need to quickly create custom template in your VB.NET application. In your VB.NET project or application you may simply copy & paste the code and then run your app! Test VB.NET sample code examples whether they respond your needs and requirements for the project.

Trial version of ByteScout Document Parser SDK is available for free. Source code samples are included to help you with your VB.NET app.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Module1.vb
      
Imports ByteScout.DocumentParser ' This example demonstrates data parsing from an invoice using the custom template. Module Module1 Sub Main() Dim customTemplate As String = ".\SampleTemplate.yml" Dim inputDocument As String = ".\SampleInvoice.pdf" ' Create DocumentParser instance Using documentParser As New DocumentParser("demo", "demo") Console.WriteLine({code}quot;Loading template ""{customTemplate}""...") Console.WriteLine() documentParser.AddTemplate(customTemplate) Console.WriteLine({code}quot;Parsing ""{inputDocument}""...") Console.WriteLine() ' Parse invoice data in JSON format Dim jsonString As String = documentParser.ParseDocument(inputDocument, OutputFormat.JSON) ' Display parsed data in console Console.WriteLine("Parsing results in JSON format:") Console.WriteLine() Console.WriteLine(jsonString) End Using Console.WriteLine() Console.WriteLine("Press any key to continue...") Console.ReadLine() End Sub End Module

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Document Parser SDK Home Page

Explore ByteScout Document Parser SDK Documentation

Explore Samples

Sign Up for ByteScout Document Parser SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

SampleTemplate.yml
      
--- templateVersion: 1 sourceId: My Custom Template detectionRules: # Few regex expressions uniquely identifying the document design. # Don't forget to escape special characters. keywords: - Your Company Name - Invoice No\. - TOTAL # Expressions to extract distinct fields. # Last matching group or "<value>" group will be passed to result. fields: total: expression: TOTAL\s+(\d+\.\d+) type: decimal dateIssued: expression: Invoice Date (\d{2}/\d{2}/\d{4}) # If type is dateTime and dateFormat property is specified # the date will be converted to universal time by the specified format. type: dateTime dateFormat: MM/dd/yyyy invoiceId: expression: Invoice No. (\d+) # Static field that will be passed to result unchanged. sourceName: expression: Vendor Company static: true # Couple of fixed rectangular fields. # You can use "Template Editor" application to add them with ease. billTo: # Rectangle coordinates sequence: x, y, width, height. rect: - 32.25 - 150 - 348 - 70.5 notes: rect: - 32.25 - 227.25 - 531 - 47.25 # Optional page index parameter (zero-based) if you need to extract from specific page. pageIndex: 0 # Table data extraction. tables: - name: table1 start: # Table start after header row "Item Quantity Price Total". expression: Item\s+Quantity\s+Price\s+Total end: # Table rows last until "TOTAL" keyword. expression: TOTAL row: # Regex for table rows extraction. expression: ^\s*(?<description>\w+.*)(?<quantity>\d+)\s+(?<unitPrice>\d+\.\d{2})\s+(?<itemTotal>\d+\.\d{2})\s*$ types: # Column datatypes. Names correspond to regex matching groups. unitPrice: decimal itemTotal: decimal options: # multipage - set 'true' if table data can continue on following pages. multipage: false

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Document Parser SDK Home Page

Explore ByteScout Document Parser SDK Documentation

Explore Samples

Sign Up for ByteScout Document Parser SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Document Parser SDK Home Page

Explore ByteScout Document Parser SDK Documentation

Explore Samples

Sign Up for ByteScout Document Parser SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

prev
next