ByteScout BarCode Generator SDK - VB.NET - Print Barcode - ByteScout

ByteScout BarCode Generator SDK – VB.NET – Print Barcode

  • Home
  • /
  • Articles
  • /
  • ByteScout BarCode Generator SDK – VB.NET – Print Barcode

How to print barcode in VB.NET with ByteScout Barcode SDK

Write code in VB.NET to print barcode with this step-by-step tutorial

Sample source code below will show you how to cope with a difficult task like print barcode in VB.NET. ByteScout Barcode SDK is the fully featured library to generate barcodes. Supports QR Code, Code 39, Code 128, UPC, GS1, GS-128, PDF417, Datamatrix and many other barcode types. Includes various options for barcode generation to ensure output quality, add barcodes to new or existing pdf files and images. It can print barcode in VB.NET.

The SDK samples like this one below explain how to quickly make your application do print barcode in VB.NET with the help of ByteScout Barcode SDK. Follow the instructions from the scratch to work and copy the VB.NET code. This basic programming language sample code for VB.NET will do the whole work for you to print barcode.

ByteScout Barcode SDK free trial version is available on our website. VB.NET and other programming languages are supported.

Try ByteScout Barcode SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

BarcodePrinter.vb
      
Imports System Imports System.Collections.Generic Imports System.Text Imports Bytescout.BarCode Imports System.Drawing.Printing Imports System.Windows.Forms Imports System.Drawing Public Class BarcodePrinter Private m_barcode As New Barcode() Private m_widthInches As Single Private m_heightInches As Single Public Sub Print(ByVal type As SymbologyType, ByVal value As String, ByVal caption As String, ByVal widthInches As Single, ByVal heightInches As Single) m_barcode.Symbology = type m_barcode.Value = value m_barcode.Caption = caption m_widthInches = widthInches m_heightInches = heightInches Dim printDoc As New PrintDocument() AddHandler printDoc.PrintPage, New PrintPageEventHandler(AddressOf printDoc_PrintPage) Dim dlgSettings As New PrintDialog() dlgSettings.Document = printDoc If dlgSettings.ShowDialog() = DialogResult.OK Then printDoc.Print() End If End Sub Private Sub printDoc_PrintPage(ByVal sender As Object, ByVal e As PrintPageEventArgs) Dim position As New Point(100, 100) m_barcode.FitInto(New SizeF(m_widthInches, m_heightInches), GraphicsUnit.Inch) m_barcode.Draw(e.Graphics, position) End Sub End Class

Try ByteScout Barcode SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

Module1.vb
      
Imports Bytescout.BarCode Module Module1 Sub Main() Dim bPrinter As New BarcodePrinter() bPrinter.Print(SymbologyType.Code39, "0123456789", "Case Number", 3.5F, 1.0F) End Sub End Module

Try ByteScout Barcode SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

VIDEO

ON-PREMISE VERSION INFORMATION

Get 60 Day Free Trial or Visit ByteScout Barcode SDK Home Page

Explore ByteScout Barcode SDK Documentation

Get ByteScout Barcode SDK Free Training

WEB API

Get Your Free API Key

Explore Web API Documentation

Tutorials:

prev
next