This sample source code below will display you how to find ssn number in pdf with regex with pdf extractor sdk in VB.NET. ByteScout Premium Suite is the set that includes 12 SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording. It can be applied to find ssn number in pdf with regex with pdf extractor sdk using VB.NET.
The SDK samples given below describe how to quickly make your application do find ssn number in pdf with regex with pdf extractor sdk in VB.NET with the help of ByteScout Premium Suite. Follow the instructions from scratch to work and copy the VB.NET code. Complete and detailed tutorials and documentation are available along with installed ByteScout Premium Suite if you’d like to learn more about the topic and the details of the API.
If you want to try other source code samples then the free trial version of ByteScout Premium Suite is available for download from our website. Just try other source code samples for VB.NET.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
Imports Bytescout.PDFExtractor
Module Program
Sub Main()
Try
' Create Bytescout.PDFExtractor.TextExtractor instance
Using extractor As TextExtractor = New TextExtractor()
extractor.RegistrationName = "demo"
extractor.RegistrationKey = "demo"
' Load sample PDF document
extractor.LoadDocumentFromFile("samplePDF_SSNNo.pdf")
' Enable the regular expression
extractor.RegexSearch = True
Dim pageCount As Integer = extractor.GetPageCount()
' Search through pages
For i As Integer = 0 To pageCount - 1
' Search SSN in format 202-55-0130
Dim regexPattern As String = "[0-9]{3}-[0-9]{2}-[0-9]{4}"
' See the complete regular expressions reference at https://msdn.microsoft.com/en-us/library/az24scfc(v=vs.110).aspx
' Search each page for the pattern
If extractor.Find(i, regexPattern, False) Then
Do
' Iterate through each element in the found text
For Each element As ISearchResultElement In extractor.FoundText.Elements
Console.WriteLine("Found SSN No: " & element.Text)
Next
Loop While extractor.FindNext()
End If
Next
End Using
Catch ex As Exception
Console.WriteLine("Error: " & ex.Message)
End Try
Console.WriteLine()
Console.WriteLine("Press enter key to continue...")
Console.ReadLine()
End Sub
End Module
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
Get Your API Key
Explore Web API Docs
Explore Web API Samples
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
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: