ByteScout PDF Extractor SDK – VB.NET – Make Searchable PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Extractor SDK – VB.NET – Make Searchable PDF

ByteScout PDF Extractor SDK – VB.NET – Make Searchable PDF

Module1.vb

Imports Bytescout.PDFExtractor

Module Module1

    Sub Main()

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

        ' Load sample PDF document
        searchablePdfMaker.LoadDocumentFromFile("sample_ocr.pdf")

        ' Set the location of "tessdata" folder containing language data files
        searchablePdfMaker.OCRLanguageDataFolder = "c:\Program Files\Bytescout PDF Extractor SDK\Redistributable\net2.00\tessdata\"

        ' Set OCR language
        searchablePdfMaker.OCRLanguage = "eng" ' "eng" for english, "deu" for German, "fra" for French, "spa" for Spanish etc - according to files in /tessdata

        ' Set PDF document rendering resolution
        searchablePdfMaker.OCRResolution = 300

        ' Save extracted text to file
        searchablePdfMaker.MakePDFSearchable("output.pdf")

        ' Cleanup
        searchablePDFMaker.Dispose()

        ' Open output file in default associated application
        System.Diagnostics.Process.Start("output.pdf")

    End Sub

End Module


  Click here to get your Free Trial version of the SDK

prev
next