Get Word Coordinates in JSON - VB.NET
PDF Extractor SDK sample in VB.NET demonstrating ‘Get Word Coordinates in JSON’
Module1.vb
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Bytescout.PDFExtractor
Imports System.Diagnostics
Namespace ConsoleApplication1
Class Program
Shared Sub Main(ByVal args As String())
' Create Bytescout.PDFExtractor.JSONExtractor instance
Dim extractor As New 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")
' Cleanup
extractor.Dispose()
Console.WriteLine()
Console.WriteLine("Data has been extracted to 'output.json' file.")
Console.WriteLine()
Console.WriteLine("Press any key to continue and open JSON file in default viewer...")
Console.ReadKey()
' Open result file in default associated application (for demo purposes)
Process.Start("output.json")
End Sub
End Class
End Namespace
Resources.Designer.vb
��' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
' <