Logo 
Search:

VB.Net Articles

Submit Article
Home » Articles » VB.Net » Utility CodeRSS Feeds

Demo code of creating barcodes in asp.net using vb.net

Posted By: Rachel Liu     Category: VB.Net     Views: 11033

barcode generation in vb.net using a custom barcode control

Code for Demo code of creating barcodes in asp.net using vb.net in VB.Net

Dim barcode As Terrek.Barcode.DotNET.DotNETControl = New Terrek.Barcode.DotNET.DotNETControl
'Set barcode type, encode data, resize and UOM properties
barcode.Symbol = Terrek.Barcode.BarcodeSymbol.QRCode
barcode.BarcodeData = "Terrek_QR_Code_VB.NET"
barcode.ImageResize = True
barcode.MeasuringUnit = Terrek.Barcode.MeasuringUnit.PIXEL
'Special setting of QR Code
barcode.Tilde = False
barcode.QRCodeDataMode= Terrek.Barcode.QRCodeDataMode.Auto
barcode.FNC1 = Terrek.Barcode.FNC1.FNC1_0
barcode.QRCodeECL = Terrek.Barcode.QRCodeECL.H
barcode. QRVersion = Terrek.Barcode.QRCodeVersion.V11
'Define how the bars are placed in a barcode image
barcode.BarAlign = Terrek.Barcode.BarAlign.Center
' QR Code module width and height
barcode.BarWidth = 1
barcode.BarHeight = 40
' Specify QR Code barcode image
barcode.DotsPerInch = 96
barcode.Rotation = Terrek.Barcode.Rotation.Degree0
barcode.BarcodeFormat = System.Drawing.Imaging.ImageFormat.Png
barcode.SaveAsImage("C:\qr_code.png")
' Specify QR Code barcode image color
barcode.ImageColor = Color.White
barcode.BarColor = Color.Black
Drawing & printing barcode to .NET Graphics, Stream & Bitmap Objects
PublicSub drawBarcode(ByRef graphics As Graphics)
PublicSub drawBarcode(ByVal filename AsString)
PublicFunction drawBarcode() As Bitmap
PublicSub drawBarcode(ByRef fileStream As Stream)
  
Share: 


Didn't find what you were looking for? Find more on Demo code of creating barcodes in asp.net using vb.net Or get search suggestion and latest updates.

Rachel Liu
Rachel Liu author of Demo code of creating barcodes in asp.net using vb.net is from China.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
David Beckham from United States Comment on: Aug 14
Here is another sample code to create Code 39 barcode in asp.net using vb.net:
Imports OnBarcode.Barcode


Dim barcode As Linear = New Linear

'Code 39 Barcode Basic Settings
barcode.Type = BarcodeType.CODE39

'Code39 Valid data char set:
'0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (Digits)
'A - Z (Uppercase letters)
'- (Dash), $ (Dollar), % (Percentage), (Space), . (Point), / (Slash), + (Plus)

'Code39 extension Valid data char set:
'All ASCII 128 characters
'Code39 encodes upper case chars only, for lower case chars, use Code 39 extension
barcode.Data = "ONBARCODE"

barcode.AddCheckSum = True

'Set the ProcessTilde property to true, if you want use the tilde character "~"
'to specify special characters in the input data. Default is false.

'1) 1-byte character: ~0dd/~1dd/~2dd (character value from 000 ~ 255);
'ASCII character '~' is presented by ~126;Strings from "~256" to "~299" are unused
barcode.ProcessTilde = False

'Code 39 Wide Narrow bar Ratio
'Valid value is from 2.0 to 3.0 inclusive.
barcode.N = 3.0F
'The space between 2 characters in code 39; This a multiple of X; The default is 1.;
'Valid value is from 1.0 (inclusive) to 5.3 (exclusive)
barcode.I = 1.0F
barcode.ShowStartStopInText = False

'Barcode Size Related Settings
barcode.UOM = UnitOfMeasure.PIXEL
barcode.X = 1
barcode.Y = 80
barcode.LeftMargin = 0
barcode.RightMargin = 0
barcode.TopMargin = 0
barcode.BottomMargin = 0
barcode.Resolution = 96
barcode.Rotate = Rotate.Rotate0

' Barcode Text Settings
barcode.ShowText = True
barcode.TextFont = New Drawing.Font("Arial", 9.0F, Drawing.FontStyle.Regular)
barcode.TextMargin = 6

' Image format setting
barcode.Format = System.Drawing.Imaging.ImageFormat.Gif()

barcode.drawBarcode("c://code-39.gif")

For detailed info, you can refer to this:
http://www.onbarcode.com/vb_net/code-39-generator.html

Taler Ko from United States Comment on: May 09
nice job.and I found barcode generating library inVB.NET .this page could definitely help someone wanting to generate Linear, postal and 2D barcodes .

www.rasteredge.com/.../

Taler Ko from United States Comment on: May 09
nice job.and I found barcode generating library inVB.NET .this page could definitely help someone wanting to generate Linear, postal and 2D barcodes .

www.rasteredge.com/.../

View All Comments