Link Search Menu Expand Document

Download and Process file - VB.NET

PDF Extractor SDK sample in VB.NET demonstrating ‘Download and Process file’

Imports System.IO
Imports Bytescout.PDFExtractor

Class Program
    Friend Shared Sub Main(args As String())

        ' Create Bytescout.PDFExtractor.TextExtractor instance
        Dim extractor As New TextExtractor()
        extractor.RegistrationName = "demo"
        extractor.RegistrationKey = "demo"

        ' Input file Url
        Dim inputUrl As String = ""

        ' Get Input Stream
        Dim inpStream As Stream = GetStreamFromUrl(inputUrl)

        ' Load sample PDF document from stream

        ' Save extracted text to file

        ' Cleanup

        ' Open result file in default associated application (for demo purposes)
    End Sub

    ''' <summary>
    ''' Get stream from Url
    ''' </summary>
    Private Shared Function GetStreamFromUrl(ByVal url As String) As Stream

        Dim oData As Byte() = Nothing

        Using wc As New System.Net.WebClient()
            oData = wc.DownloadData(url)
        End Using

        Return New MemoryStream(oData)

    End Function

End Class

Download Source Code (.zip)

Return to the previous page Explore PDF Extractor SDK