ByteScout PDF Extractor SDK - VBScript - Find PDF Table And Extract As CSV - ByteScout

ByteScout PDF Extractor SDK – VBScript – Find PDF Table And Extract As CSV

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Extractor SDK – VBScript – Find PDF Table And Extract As CSV

How to find PDF table and extract as CSV in VBScript and ByteScout PDF Extractor SDK

The tutorial shows how to find PDF table and extract as CSV in VBScript

These sample source codes on this page below are demonstrating how to find PDF table and extract as CSV in VBScript. ByteScout PDF Extractor SDK: the SDK that helps developers to extract data from unstructured documents, pdf, images, scanned and electronic forms. Includes AI functions like automatic table detection, automatic table extraction and restructuring, text recognition and text restoration from pdf and scanned documents. Includes PDF to CSV, PDF to XML, PDF to JSON, PDF to searchable PDF functions as well as methods for low level data extraction. It can find PDF table and extract as CSV in VBScript.

The SDK samples like this one below explain how to quickly make your application do find PDF table and extract as CSV in VBScript with the help of ByteScout PDF Extractor SDK. Follow the instructions from the scratch to work and copy the VBScript code. Use of ByteScout PDF Extractor SDK in VBScript is also explained in the documentation included along with the product.

You can download free trial version of ByteScout PDF Extractor SDK from our website to see and try many others source code samples for VBScript.

Try it today: Get 60 Day Free Trial or sign up for Web API

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

Try it today: Get 60 Day Free Trial or sign up for Web API

MORE INFORMATION

Get 60 Day Free Trial or Visit ByteScout PDF Extractor SDK page

Explore ByteScout PDF Extractor SDK documentation

WEB API VERSION

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next