ByteScout PDF Renderer SDK - VB.NET - PDF To BMP (using Streams) - 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 Renderer SDK – VB.NET – PDF To BMP (using Streams)

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Renderer SDK – VB.NET – PDF To BMP (using Streams)

ByteScout PDF Renderer SDK – VB.NET – PDF To BMP (using Streams)

Program.vb


Imports Bytescout.PDFRenderer
Imports System.IO


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

        Dim srcStream = New FileStream("multipage.pdf", FileMode.Open)

        ' Create an instance of Bytescout.PDFRenderer.RasterRenderer object and register it.
        Using renderer = New RasterRenderer("demo", "demo")

            ' Load PDF document.
            renderer.LoadDocumentFromStream(srcStream)

            For i As Integer = 0 To renderer.GetPageCount() - 1

                Dim fileName As String = "page" & i & ".png"

                If File.Exists(fileName) Then File.Delete(fileName)

                ' Render first page of the document to PNG image file.
                Using destStream As New FileStream(fileName, FileMode.CreateNew)
                    renderer.Save(destStream, RasterImageFormat.PNG, i, 300)
                End Using

            Next

        End Using

        ' Open the first output file in default image viewer.
        System.Diagnostics.Process.Start("page0.png")

    End Sub
End Class


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next