Barcode Quickstart
IronBarCode supports various standard formats, from image files (jpeg, png, and jpg) to more programmatic formats where you would want to pass the variables around, such as a bitmap. Furthermore, it also supports external formats such as PDF, allowing IronBarCode to integrate seamlessly in any codebase, giving developers flexibility with file formats and variables.
Aside from being a barcode reader for all file formats, IronBarcode also doubles as a barcode generator that supports all standard encoding and formatting, such as the EAN8
, Code128
and Code39
. Setting the barcode generator up only takes two lines of code. With a low barrier of entry and plenty of customization options for developers, IronBarCode is the number one choice for all situations related to barcodes.
Barcode Reader and Barcode Generator in C#
- var myBarcode = BarcodeWriter.CreateBarcode("12345", BarcodeWriterEncoding.EAN8);
- Image myBarcodeImage = myBarcode.Image;
- myBarcode.ResizeTo(400, 100);
- var resultFromFile = BarcodeReader.Read(@"file/barcode.png");
- var myOptionsExample = new BarcodeReaderOptions{...}
BarcodeWriter
We first import the IronBarCode
and System.Drawing
and instantiate BarcodeWriter
to create a barcode with the string value of 12345
with the format of EAN8
. We then save the generated barcode as an image in the desired format. There are various options for this as IronBarCode supports creating the barcode as an Image
as well as a Bitmap
.
Advanced BarcodeWriter
As seen from above, generating a barcode using IronBarCode requires only two lines of code and saving it as a file for later usage. IronBarCode further extends this by providing developers with a plethora of options to customize the barcode to match the situation. We can use the ResizeTo
method and pass in the height and width to resize the barcode image.
Barcode Reader
Like the above, we first instantiate BarcodeReader
, pass the file path to the Read
method, and save it as a variable to use later and manipulate the barcode object. There are specified methods for reading external formats such as PDF with ReadPDF
; however, for general image formats and bitmaps, we would use Read
.
BarcodeReaderOptions
IronBarCode allows developers to scan barcodes from standard file format. However, there are situations where the developers want to fine-tune the behavior of the Read
method, especially in cases where it is reading a batch of barcode files programmatically. This is where BarcodeReaderOptions
comes in. IronPDF lets you fully customize things such as the speed at which it reads with Speed
, whether they are multiple barcodes expected on the file with ExpectedMultipleBarcodes
, and what kind of barcodes they are with the property ExpectBarcodeTypes
. Allowing developers to run multiple threads to read barcodes from multiple images in parallel and the number of threads used when doing parallel reading. These are just some of the properties that showcase the power of IronBarCode, for a complete list, please refer to the documentation here
Click here to view the How-to-Guide, including examples, sample code and files >