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

VB Imaging - UPC-A Barcode Generator


How to Add and Insert UPC-A Barcode to Image & Document in VB




VB Imaging - UPC-A Barcode Add-on Overview



RasterEdge DocImage SDK for .NET barcode generator is able to generate many kinds of 1D and 2D barcodes for users in VB.NET. UPC-A is a barcode symbology widely used in the United States, Canada and other countries. People use UPC-A barcode to track trade items in stores. itext add text to existing pdf c#, convert text file to pdf using c#, c# scale pdf page, count pages in pdf without opening c#, how to merge two pdf files in c# using itextsharp, c# convert csv to pdf, free pdf sdk vb.net.


Related .net document control helps:
asp.net edit pdf image using c#: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C#
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...
asp.net mvc image viewer: ASP.NET Image Viewer Control(MVC & WebForms): view, annotate, redact, convert image files in html, JQuery
asp.net view powerpoint: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET
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 image using c#: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C#
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...


Our UPC-A barcode generator control can generate UPC-A barcode on images (GIF, BMP, PNG, JPEG, etc ) and documents ( PDF, Tiff, Word, DICOM) easily in VB project. In addition to that, the properties of UPC-A barcode is customizable, such as the barcode width & height, the human-readable text font and the resolution of UPC-A barcode. asp.net core open excel file, open word document in asp.net c#, asp.net preview pdf, display pdf in mvc, show image in repeater asp.net, asp.net edit pdf, pdf viewer in asp.net c#. You can also decide the location and rotating angle of the UPC-A barcode. Below is a feature list of our UPC-A barcode generator, please take a look.


Generate UPC-A barcode at fast speed in VB.NET


Easily integrate with other image .NET SDK in VB project


Created UPC-A barcodes are compatible with industry standards


Generated UPC-A barcode can be scanned by common barcode scanner


Free to customize and modify UPC-A barcode parameters in VB.NET




VB Code for Customizing UPC-A Barcode Generation



You can easily generator UPC-A barcode and save it  to image files/object using this VB.NET barcode generator control. The following steps will show how to create a UPC-A type barcode encoding numeric data text "01234567890" 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 UPC-A barcode.




'create a barcode
Dim barcode As Linear = New Linear()
'select barcode type
barcode.Type = BarcodeType.UPCA
'set barcode data
barcode.Data = "01234567890"
'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")





How to Add UPC-A Barcode to Image in VB



In this section, you can find sample VB code, which is used to illustrate how to create and draw UPC-A barcode on source image, picture or photo in .NET class application. Now, our Barcode Generator DLL for VB.NET supports creating UPC-A barcode on BMP, GIF, JPEG, and PNG image files. Remarkably, developers can draw linear UPC-A barcode at any desired place on source image file as this VB UPC-A Barcode Generator DLL provides the application of X & Y location.




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





How to Create UPC-A on Document Page in VB



This VB UPC-A barcode generator SDK is often used by developers for the purpose of adding linear UPC-A barcode to document files, like PDF, TIFF, MS Word, Excel and PowerPoint. What should be noted here is that, using RasterEdge UPC-A barcode creator SDK, you can create and insert UPC-A barcode at any specified location of any page on target document files accurately by VB programming code.



How to Insert UPC-A Barcode into PDF Using 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")




How to Draw UPC-A on TIFF Using VB.NET



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




How to Add UPC-A to Word Document in 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")




How to Draw UPC-A on Excel Document in 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")




How to Create UPC-A Barcode to PPT Slide



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





Entire VB Code for Customizing UPC-A Barcode



As is said above, RasterEdge UPC-A barcode creator add-on for VB owns comprehensive barcode generating functions, which allows VB developers to create a fully-customized UPC-A barcode and insert generated UPC-A barcode into source document image file. In this section, we particularly illustrate VB code demo for developers, which can be used to create UPC-A barcode and customize each property of generated barcode image on sample PNG image file.




'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.UPCA
'set barcode data 
barcode.Data = "01234567890"

'UPC-A 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.Center
'set resolution
barcode.Resolution = 72
'set rotation
barcode.Rotate = Rotate.Rotate0
barcode.AddCheckSum = false
barcode.UOM = UnitOfMeasure.PIXEL

'UPC-A colors
barcode.BackColor = System.Drawing.Color.White
barcode.ForeColor = System.Drawing.Color.Black

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

'UPC-A special
'barcode.SupData = ""
'barcode.SupHeight = 0.8f
'barcode.SupSpace = 15f

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

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