Link Search Menu Expand Document

Get Word Coordinates in JSON - VBScript

PDF Extractor SDK sample in VBScript demonstrating ‘Get Word Coordinates in JSON’

PdfToJson.vbs
' Create Bytescout.PDFExtractor.JSONExtractor object
Set extractor = CreateObject("Bytescout.PDFExtractor.JSONExtractor")
extractor.RegistrationName = "demo"
extractor.RegistrationKey = "demo"

' Load sample PDF document
extractor.LoadDocumentFromFile "sample3.pdf"

' Add the following params to get clean data with word nodes only:
extractor.DetectNewColumnBySpacesRatio = 0.1 ' This splits all text into words
extractor.PreserveFormattingOnTextExtraction = false ' Get rid of empty nodes

extractor.SaveJSONToFile "output.json"

WScript.Echo "Extracted data saved to 'output.json' file."

Download Source Code (.zip)

Return to the previous page Explore PDF Extractor SDK


Copyright © 2016 - 2021 ByteScout