ByteScout Premium Suite - VBScript - Find pdf table and extract as csv with pdf extractor sdk - ByteScout

ByteScout Premium Suite – VBScript – Find pdf table and extract as csv with pdf extractor sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Premium Suite – VBScript – Find pdf table and extract as csv with pdf extractor sdk

How to find pdf table and extract as csv with pdf extractor sdk in VBScript using ByteScout Premium Suite

This code in VBScript shows how to find pdf table and extract as csv with pdf extractor sdk with this how to tutorial

Sample source code below will display you how to manage a complex task like find pdf table and extract as csv with pdf extractor sdk in VBScript. ByteScout Premium Suite is the set that includes 12 SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording and you can use it to find pdf table and extract as csv with pdf extractor sdk with VBScript.

Want to save time? You will save a lot of time on writing and testing code as you may just take the VBScript code from ByteScout Premium Suite for find pdf table and extract as csv with pdf extractor sdk below and use it in your application. IF you want to implement the functionality, just copy and paste this code for VBScript below into your code editor with your app, compile and run your application. This basic programming language sample code for VBScript will do the whole work for you to find pdf table and extract as csv with pdf extractor sdk.

ByteScout Premium Suite free trial version is available on our website. VBScript and other programming languages are supported.

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

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

FindTableAndExtractAsCSV.vbs
      
' Create Bytescout.PDFExtractor.TextExtractor object Set tableDetector= CreateObject("Bytescout.PDFExtractor.TableDetector") tableDetector.RegistrationName = "demo" tableDetector.RegistrationKey = "demo" ' Create Bytescout.PDFExtractor.CSVExtractor object Set csvExtractor = CreateObject("Bytescout.PDFExtractor.CSVExtractor") csvExtractor.RegistrationName = "demo" csvExtractor.RegistrationKey = "demo" ' We should define what kind of tables we should detect. ' So we set min required number of columns to 3 ... tableDetector.DetectionMinNumberOfColumns = 3 ' ... and we set min required number of rows to 3 tableDetector.DetectionMinNumberOfRows = 3 ' Set table detection mode to "bordered tables" - best for tables with closed solid borders. tableDetector.ColumnDetectionMode = 3 ' 3 = ColumnDetectionMode.BorderedTables ' Load sample PDF document tableDetector.LoadDocumentFromFile("..\..\sample3.pdf") csvExtractor.LoadDocumentFromFile "..\..\sample3.pdf" ' Get page count pageCount = tableDetector.GetPageCount() ' Iterate through pages For i = 0 to pageCount - 1 t = 0 ' Find first table and continue if found If (tableDetector.FindTable(i)) Then Do ' Set extraction area for CSV extractor to rectangle received from the table detector csvExtractor.SetExtractionArea _ tableDetector.GetFoundTableRectangle_Left(), _ tableDetector.GetFoundTableRectangle_Top(), _ tableDetector.GetFoundTableRectangle_Width(), _ tableDetector.GetFoundTableRectangle_Height() ' Export the table to CSV file csvExtractor.SavePageCSVToFile i, "page-" & CStr(i) & "-table-" & CStr(t) & ".csv" t = t + 1 Loop While tableDetector.FindNextTable() End If Next Set csvExtractor = Nothing Set tableDetector = Nothing

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite 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 Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next