ByteScout PDF Extractor SDK - VB.NET - PDF To JSON With Images - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout PDF Extractor SDK – VB.NET – PDF To JSON With Images

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Extractor SDK – VB.NET – PDF To JSON With Images

ByteScout PDF Extractor SDK – VB.NET – PDF To JSON With Images

Module1.vb

Imports Bytescout.PDFExtractor

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("sample1.pdf")

            ' Uncomment this line to get rid of empty nodes in JSON
            'extractor.PreserveFormattingOnTextExtraction = False

            ' Set output image format
            extractor.ImageFormat = OutputImageFormat.PNG

            ' Save images to external files
            extractor.SaveImages = ImageHandling.OuterFile
            extractor.ImageFolder = "images" ' Folder for external images
            extractor.SaveJSONToFile("result_with_external_images.json")

            ' Embed images into JSON as Base64 encoded string
            extractor.SaveImages = ImageHandling.Embed
            extractor.SaveJSONToFile("result_with_embedded_images.json")

            ' Cleanup
		    extractor.Dispose()

        End Sub

    End Class
    
End Namespace



  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next