C#: Online Guide
How To: Barcode Generator
Code 2 of 5
Code 2 of 5
  |  
Home ›› XImage.Barcode Generator ›› VB Barcode Generator: Code 2 of 5

VB Imaging - VB Code 2 of 5 Generator


Create Code 2 of 5 Barcode in VB.NET Project Images and Documents




VB Imaging - Code 2 of 5 Barcode Generator Overview



This VB.NET Code 2 of 5 barcode creator add-on is a professional linear barcode generator SDK, which is developed specifically for .NET Framework applications. This online tutorial page aims to help you have a deeper and quicker understanding of this VB.NET Code 2 of 5 barcode drawing control add-on. From this page, you will find detailed VB.NET programming code demos for Code 2 of 5 barcode generation on image & document. Code 2 of 5 Barcode Creator Add-on of RasterEdge DocImage SDK for .NET is a fully-functional barcode generating control DLL. It can be easily integrated into VB.NET imaging projects such as VB class library, ASP.NET web projects and windows applications. To use this library, the minimum requirement is the installation of MS Visual Studio 2005 or later. merge 2 pdf in vb.net, vb.net adobe pdf sdk, convert pptx to pdf c#, c# create pdf page, c# create pdf with password, convert pdf to svg c#, vb.net pdf add pages.


Related .net document control helps:
asp.net view tiff images: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control
asp.net pdf document viewer c#: ASP.NET PDF Document Viewer in C#: open, display, view, annotate, redact Adobe PDF files online in ASP.NET MVC & WebForm...
c# asp.net text file viewer: ASP.NET Text file viewer in MVC, WebForms: Open, view, annotate, convert txt files in C# ASP.NET
asp.net annotate pdf using c#: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C#
asp.net edit pdf image using c#: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C#
asp.net sharepoint document viewer open source: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
asp.net mvc word viewer: ASP.NET Office Word Document Viewer: view Word doc files online using C# in ASP.NET MVC web applications


Detailed features are listed below:


Written in managed VB code for .NET Framework


Generate, print Code 2 of 5 linear bar codes with complete VB sample codes


Adjust Code 2 of 5 barcode size with parameters listed in the table below


Printing, writing Code 2 of 5 barcodes on jpg, gif, png, and bmp images using VB


Draw and embed high-quality Code 2 of 5 on PDF, TIFF, Microsoft Word, Excel and PowerPoint documents


Besides this VB barcode generation guide, we also provide developers with VB.NET Code 2 of 5 Barcode Drawing Tutorial.




VB Code for Customizing Code 2 of 5 Barcode Generation



You can easily generator Code 2 of 5 barcode and save it  to image files/object using this VB.NET barcode generator control. The following steps will show how to create a Code 2 of 5 type barcode encoding numeric data text "112233445566" into the image object with XImage.Barcode.Creator.

preview pdf in asp.net mvc, asp.net multipage tiff viewer, asp.net edit pdf, asp.net core open excel file, asp net remove text from pdf javascript, asp net core mvc pdf viewer download, how to show pdf file in asp.net page c#.


Add References


  RasterEdge.Imaging.Basic.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XImage.BarcodeCreator.dll


  System.Drawing.dll


Using Namespaces


  using System.Drawing;


  using RasterEdge.XImage.BarcodeCreator;


Note: When you get the error "Could not load file or assembly 'RasterEdge.Imaging.Basic' or any other assembly or one of its dependencies. An attempt to load a program with an incorrect format", please check your configure as follows:

       

       If you are using x64 libraries/dlls, Right click the project -> Properties -> Build -> Platform target: x64.

       

       If using x86, the platform target should be x86.


Please copy the sample code as follow to generator a Code 2 of 5 barcode.




'create a barcode
Dim barcode As Linear = New Linear()
'select barcode type
barcode.Type = BarcodeType.CODA2OF5
barcode.Data = "112233445566"'set barcode data
barcode.X = 1.0F'set x
barcode.Y = 60.0F'set y
barcode.Resolution = 96'set resolution
barcode.Rotate = Rotate.Rotate0'set rotation
barcode.BarcodeWidth = 200
barcode.BarcodeHeight = 200
barcode.AutoResize = true

'convert barcode to a bitmap and save it to image file
'Dim bmp As Bitmap = barcode.ToImage()
'bmp.Save(@"C:\barcode.bmp")





VB Imaging - Create Code 2 of 5 Barcode on Image



This VB.NET library add-in is designed to help developers create, draw Code 2 of 5 bar codes on various image files. Supported image formats include png, gif, jpeg, and bmp. The sample code below is taking the png image format for Code 25 generation as an example. Copy and paste it to your VB.NET image program for a test and make necessary adjustment on the VB code to create custom Code 2 of 5 image. You can view detailed settings in the property table below.




Dim image As REImage  = New REImage("C:\\Sample.png")
barcode.DrawBarcode(image, 150F, 150F)
image.Save(ImageType.PNG, "C:\\Sample_Barcode.png")





VB Imaging - Insert Code 2 of 5 Barcode on Document



Apart from the image processing project, this VB.NET barcode generator add-on can be also used in those document managing & manipulating projects. Using this .NET Code 2 of 5 barcode creator add-on, you can easily generate & insert Code 2 of 5 barcode on PDF, TIFF, Word, Excel and PowerPoint documents.



Code 2 of 5 Barcode Generation on PDF Page



Add References(Extra)


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.XImage.Raster.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XDoc.PDF.dll


Using Namespace(Extra)


  RasterEdge.XDoc.PDF;


  RasterEdge.Imaging.Basic;


  RasterEdge.Imaging.Raster.Core;



Dim  docx As PDFDocument = New PDFDocument("C:\\Sample.pdf")
Dim  page As PDFPage = docx.GetPage(0)
Dim  image As Bitmap = barcode.ToImage() 'Define on the above code
page.AddImage(image, New PointF(100F, 100F))
docx.Save("C:\\Sample_Barcode.pdf")




Code 2 of 5 Barcode Generation on TIFF Page



Add References(Extra)


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.XImage.Raster.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XDoc.TIFF.dll


Using Namespace(Extra)


  RasterEdge.XDoc.TIFF;


  RasterEdge.Imaging.Basic;


  RasterEdge.Imaging.Raster.Core;




Dim  docx As TIFFDocument = New TIFFDocument("C:\\Sample.tif")
Dim page As BasePage = docx.GetPage(0)
Dim  image As REImage = New REImage(barcode.ToImage())
page.AddImage(image, New PointF(100F, 100F))
docx.Save("C:\\Sample_Barcode.tif")




Code 2 of 5 Barcode Generation on Word Page



Add References(Extra)


  RasterEdge.XDoc.Word.dll


  RasterEdge.XImage.Raster.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XDoc.Office.Inner.Common.dll


  RasterEdge.XDoc.Office.Inner..Office03.dll


Using Namespace(Extra)


  RasterEdge.XDoc.Word;


  RasterEdge.Imaging.Basic;


  RasterEdge.Imaging.Raster.Core;




Dim  docx As DOCXDocument = New DOCXDocument("C:\\Sample.docx")
Dim page As BasePage = docx.GetPage(0)
Dim  image As REImage = New REImage(barcode.ToImage())
page.AddImage(image, New PointF(100F, 100F))
docx.Save("C:\\Sample_Barcode.docx")




Create and Save Code 2 of 5 on Excel Document



Add References(Extra)


  RasterEdge.XDoc.Excel.dll


  RasterEdge.XImage.Raster.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XDoc.Office.Inner.Common.dll


  RasterEdge.XDoc.Office.Inner..Office03.dll


Using Namespace(Extra)


  RasterEdge.XDoc.Excel;


  RasterEdge.Imaging.Basic;


  RasterEdge.Imaging.Raster.Core;




Dim  docx As XLSXDocument = New XLSXDocument("C:\\Sample.xlsx")
Dim page As BasePage = docx.GetPage(0)
Dim  image As REImage = New REImage(barcode.ToImage())
page.AddImage(image, New PointF(100F, 100F))
docx.Save("C:\\Sample_Barcode.xlsx")




VB Code to Draw Code 2 of 5 Barcode to PowerPoint Page



Add References(Extra)


  RasterEdge.XDoc.PowerPoint.dll


  RasterEdge.XImage.Raster.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XDoc.Office.Inner.Common.dll


  RasterEdge.XDoc.Office.Inner..Office03.dll


Using Namespace(Extra)


  RasterEdge.XDoc.PowerPoint;


  RasterEdge.Imaging.Basic;


  RasterEdge.Imaging.Raster.Core;




Dim  docx As PPTXDocument = New PPTXDocument("C:\\Sample.pptx")
Dim page As BasePage = docx.GetPage(0)
Dim  image As REImage = New REImage(barcode.ToImage())
page.AddImage(image, New PointF(100F, 100F))
docx.Save("C:\\Sample_Barcode.pptx")





VB Sample Code for Code 2 of 5 Customization



From the following VB code, you will see how to generate a customized Code 2 of 5 barcode on a png image file in .NET class application. All the properties listed above are demonstrated, please make any modification if necessary.




'create REImage on which you want to draw the barcode
Dim reImage As REImage = New REImage("c:/Sample.png")

'create a barcode
Dim barcode As Linear = New Linear()
'select barcode type
barcode.Type = BarcodeType.CODE2OF5
'set barcode data 
barcode.Data = "0123456789"

'Code 2 of 5 size settings
barcode.UOM = UnitOfMeasure.PIXEL
barcode.X = 2.0F
barcode.Y = 80F
barcode.BarcodeHeight = 120
barcode.BarcodeWidth = 120
barcode.BottomMargin = 20
barcode.TopMargin = 20
barcode.BottomMargin = 20
barcode.LeftMargin = 20
barcode.RightMargin = 20
barcode.AutoResize = false
barcode.BarAlignment = AlignmentHori.Center

'Code 2 of 5 unique features
barcode.N = 2

'color-related settings
barcode.BackColor = System.Drawing.Color.White
barcode.ForeColor = System.Drawing.Color.Black

'human-readable text-related settings
barcode.ShowText = true
barcode.TextFont = New Font("Arial", 9f, FontStyle.Regular)
barcode.TextMargin = 6F
barcode.TextColor = System.Drawing.Color.Black

'other related settings
barcode.Resolution = 96
barcode.Rotate = Rotate.Rotate0

barcode.DrawBarcode(reImage, 0, 0)'draw barcode on REImage with location x and y

reImage.Save(ImageType.PNG, "c:/barcode.png")