ByteScout Premium Suite - VB.NET - Pdf to image rendering in background thread with pdf renderer sdk - ByteScout

ByteScout Premium Suite – VB.NET – Pdf to image rendering in background thread with pdf renderer sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Premium Suite – VB.NET – Pdf to image rendering in background thread with pdf renderer sdk

pdf to image rendering in background thread with pdf renderer sdk in VB.NET using ByteScout Premium Suite

Simple tutorial on how to do pdf to image rendering in background thread with pdf renderer sdk in VB.NET

Every ByteScout tool includes sampleVB.NET source codes that you can find here or in the folder with installed ByteScout product. ByteScout Premium Suite was made to help with pdf to image rendering in background thread with pdf renderer sdk in VB.NET. ByteScout Premium Suite is the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording.

Want to speed up the application development? Then this VB.NET, code samples for VB.NET, developers help to speed up the application development and writing a code when using ByteScout Premium Suite. To use pdf to image rendering in background thread with pdf renderer sdk in your VB.NET project or application just copy & paste the code and then run your app! This basic programming language sample code for VB.NET will do the whole work for you in implementing pdf to image rendering in background thread with pdf renderer sdk in your app.

ByteScout Premium Suite is available as a free trial. You may get it from our website along with all other source code samples for VB.NET applications.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.vb
      
Imports System.IO Imports System.Threading Imports Bytescout.PDFRenderer Class Program Private Shared _doneEvent As New ManualResetEvent(False) ' synchronization event Private Shared _counter As Integer ' thread counter Friend Shared Sub Main(args As String()) ' Get all PDF files in current directory Dim pdfFiles As String() = Directory.GetFiles(".", "*.pdf") _counter = pdfFiles.Length ' Render PDF files in separate threads For Each pdfFile As String In pdfFiles Dim backgroundThread As New Thread(AddressOf BackgroundThreadProc) backgroundThread.Start(pdfFile) Console.WriteLine(pdfFile & " - conversion started.") Next ' Wait until threads finished _doneEvent.WaitOne() Console.WriteLine("Done.") Console.WriteLine() Console.WriteLine("Press any key to continue...") Console.ReadKey() End Sub ' Rendering thread function Private Shared Sub BackgroundThreadProc(data As Object) Dim fileName As String = DirectCast(data, String) Try ' Create renderer Using renderer As New RasterRenderer() renderer.LoadDocumentFromFile(fileName) ' Setup rendering Dim renderingOptions As New RenderingOptions() renderingOptions.JPEGQuality = 90 Dim renderingResolution As Single = 300 ' Render document pages For i As Integer = 0 To renderer.GetPageCount() - 1 renderer.Save(fileName & ".page" & i & ".jpg", RasterImageFormat.JPEG, i, renderingResolution, renderingOptions) Next End Using Console.WriteLine(fileName & " - successfully converted.") Catch exception As Exception Console.WriteLine(exception.ToString()) End Try If Interlocked.Decrement(_counter) = 0 Then ' Set event if all threads finished _doneEvent.Set() End If End Sub End Class

ON-PREMISE OFFLINE SDK

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

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

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

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next