C#: Online Guide
How To: Barcode Generator
EAN-13
EAN-13
  |  
Home ›› XImage.Barcode Generator ›› VB Barcode Generator: EAN-13

VB Imaging - EAN-13 Creation & Printing


Generate & Insert EAN-13 Barcode into Document and Image Files Using VB




VB EAN-13 Barcode Creator Overview



Written in fully managed C# code, this VB.NET EAN-13 barcode generator add-on owns the most advanced linear barcode creating technologies that has been used since 2004. This VB.NET EAN-13 barcode generator control's perfect integration with common image and document processing applications makes it one of the most widely-used .NET imaging SDK on the market. RasterEdge .NET EAN-13 barcode generation add-on is a fully functional utility, which offers advanced and mature API for VB developers to create high-quality EAN-13 barcode and add generated EAN-13 barcode to target document or image file in both .NET web-based application and Windows Forms project.


Related .net document control helps:
document viewer asp.net c#: ASP.NET Document Viewer using C#: Open, View, Annotate, Redact, Convert document files in ASP.NET using C#, HTML5, JQuer...
asp.net document viewer free: EdgeDoc:ASP.NET Document Viewer C# Control: Open, view, annotate, redact, convert documents online in C#, VB.NET, AS...
asp.net edit pdf page control: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C#
asp.net pdf editor component: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
asp.net edit pdf text control: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET
powerpoint viewer asp.net mvc: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET
asp.net view text file: ASP.NET Text file viewer in MVC, WebForms: Open, view, annotate, convert txt files in C# ASP.NET


Here we offer a brief feature list of RasterEdge VB.NET linear EAN-13 barcode generator add-on.


Create standard EAN-13 (as well as EAN-13+2, EAN-13+5) barcode(s) on source image or document file using VB.NET code


Adopt the application of X & Y location to decide where EAN-13 barcode should be created in VB.NET


Offer the API for VB.NET developers to draw a transparent EAN-13 barcode on png image, PDF or Word document


100% .NET solution that allows developers to generate EAN-13 barcode in VB imaging applications


Generate and add created EAN-13 barcode on image file formats (JPEG, JBIG2, BMP, GIF & PNG) using VB code


Created linear EAN-13 barcode can be easily and accurately inserted into PDF, TIFF, Word, Excel and PowerPoint document files using VB.NET


Created EAN-13 barcodes meeting latest industry standards and can be read by all linear barcode readers in VB


Fully-featured EAN-13 barcode generating API that helps VB developers create customized barcode




VB Code for Customizing EAN-13 Barcode Generation



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


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 EAN-13 barcode.




'create a barcode
Dim barcode As Linear = New Linear()
'select barcode type
barcode.Type = BarcodeType.EAN13
'set barcode data
barcode.Data = "012345678901"
'set x,y position
barcode.X = 1.0F
barcode.Y = 60.0F
'set resolution
barcode.Resolution = 96
'set rotation
barcode.Rotate = Rotate.Rotate0
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")





Generate EAN-13 Barcode on Image in VB



In this section, we will offer you a VB programming example which aims to demonstrate how to generate a standard EAN-13 barcode on raster image file PNG. Using RasterEdge .NET EAN-13 barcode creator add-on, you can also generate EAN-13 barcode on other image file formats, like JPEG, BMP and GIF.




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





Generate EAN-13 on Document Page in VB



Besides generating EAN-13 barcode on image files, RasterEdge VB.NET EAN-13 barcode creator can also generate & add EAN-13 barcode on document files, like PDF, TIFF, Word, Excel and PowerPoint. Using the sample VB codes below, you can not only insert EAN-13 barcode on target document page, but also own the ability to adjust the position where created EAN-13 barcode will be located.



EAN-13 Creation on PDF Document in VB



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")




EAN-13 Creation on TIFF File Page Using VB



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")




VB EAN-13 Creation on Word Document Using VB



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")




VB EAN-13 Creation on Excel Document Using VB



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 EAN-13 Creation on PowerPoint Document Using VB



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 Code to Generate Customized EAN-13 on Document Image



The VB code demo below contains all parameters that VB developers can use to create a customized EAN-13 barcode on target image file. For example, you can adjust the size, color, font style and generating orientation of created EAN-13 barcode by VB code.




'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()
barcode.Type = BarcodeType.EAN13
'set barcode data 
barcode.Data = "012345678901"

'EAN-13 barcode size related
'set x,y position
barcode.X = 1.0F
barcode.Y = 60.0F
barcode.BarcodeHeight = 60
barcode.BarcodeWidth = 0
barcode.BottomMargin = 0
barcode.LeftMargin = 0
barcode.RightMargin = 0
barcode.BarAlignment = AlignmentHori.Left
'set resolution
barcode.Resolution = 96
'set rotation
barcode.Rotate = Rotate.Rotate0
barcode.AddCheckSum = false
barcode.UOM = UnitOfMeasure.PIXEL

'EAN-13 colors
barcode.BackColor = System.Drawing.Color.White
barcode.ForeColor = System.Drawing.Color.Black

'EAN-13 font style
barcode.TextFont = New Font("Arial", 9f, FontStyle.Regular)
barcode.TextColor = System.Drawing.Color.Black
barcode.TextMargin = 6
barcode.ShowText = true

'EAN-13 special
'barcode.SupData = ""
'barcode.SupHeight = 0.8f
'barcode.SupSpace = 15

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

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