Working with Barcode

Essential PDF provides support to add barcodes to the PDF document. The following barcode types are supported.

  • 10 one-dimensional barcodes including Code 39 and Code 32 barcodes.
  • 2 two-dimensional barcodes such as QR, DataMatrix and PDF417 barcodes

Adding a one dimensional barcode to the PDF document

The below code snippet shows how to add Code39 barcode using the PdfCode39Barcode class to a PDF document.

//Creating new PDF Document

PdfDocument doc = new PdfDocument();

//Adding new page to PDF document

PdfPage page = doc.Pages.Add();

//Drawing Code39 barcode 

PdfCode39Barcode barcode = new PdfCode39Barcode(); 

//Setting height of the barcode 

barcode.BarHeight = 45; 

barcode.Text = "CODE39$"; 

//Printing barcode on to the Pdf. 

barcode.Draw(page, new PointF(25, 70 ));

//Saving the Document

doc.Save("CODE39.pdf");
'Creating new PDF Document

Dim doc As New PdfDocument()

'Adding new page to PDF document

Dim page As PdfPage = doc.Pages.Add()

'Drawing Code39 barcode 

Dim barcode As New PdfCode39Barcode()

'Setting height of the barcode 

barcode.BarHeight = 45

barcode.Text = "CODE39$"

'Printing barcode on to the Pdf. 

barcode.Draw(page, New PointF(25, 70))

'Saving the Document

doc.Save("CODE39.pdf")
//Creating new PDF Document

PdfDocument doc = new PdfDocument();

//Adding new page to PDF document

PdfPage page = doc.Pages.Add();

//Drawing Code39 barcode 

PdfCode39Barcode barcode = new PdfCode39Barcode();

//Setting height of the barcode 

barcode.BarHeight = 45;

barcode.Text = "CODE39$";

//Printing barcode on to the Pdf. 

barcode.Draw(page, new PointF(25, 70));

//Save the PDF document to stream

MemoryStream stream = new MemoryStream();

await doc.SaveAsync(stream);

//Close the document

doc.Close(true);                                                                   

//Save the stream as PDF document file in local machine. Refer to PDF/UWP section for respected code samples

Save(stream, "output.pdf");
//Creating new PDF Document

PdfDocument doc = new PdfDocument();

//Adding new page to PDF document

PdfPage page = doc.Pages.Add();

//Drawing Code39 barcode 

PdfCode39Barcode barcode = new PdfCode39Barcode();

//Setting height of the barcode 

barcode.BarHeight = 45;

barcode.Text = "CODE39$";

//Printing barcode on to the Pdf. 

barcode.Draw(page, new PointF(25, 70));

//Save the document into stream.

MemoryStream stream = new MemoryStream();

doc.Save(stream);

stream.Position = 0;

//Close the documents.

doc.Close(true);

//Defining the ContentType for pdf file.

string contentType = "application/pdf";

//Define the file name.

string fileName = " CODE39.pdf";

//Creates a FileContentResult object by using the file contents, content type, and file name.

return File(stream, contentType, fileName);
//Creating new PDF Document

PdfDocument doc = new PdfDocument();

//Adding new page to PDF document

PdfPage page = doc.Pages.Add();

//Drawing Code39 barcode 

PdfCode39Barcode barcode = new PdfCode39Barcode();

//Setting height of the barcode 

barcode.BarHeight = 45;

barcode.Text = "CODE39$";

//Printing barcode on to the Pdf. 

barcode.Draw(page, new PointF(25, 70));

//Save the PDF document to stream

MemoryStream stream = new MemoryStream();

doc.Save(stream);

//Closes the document

doc.Close(true);

//Save the stream into pdf file

//The operation in Save under Xamarin varies between Windows Phone, Android and iOS platforms. Please refer PDF/Xamarin section for respective code samples

if (Device.OS == TargetPlatform.WinPhone || Device.OS == TargetPlatform.Windows)
{
    Xamarin.Forms.DependencyService.Get<ISaveWindowsPhone>().Save("Output.pdf", "application/pdf", stream);
}
else
{
    Xamarin.Forms.DependencyService.Get<ISave>().Save("Output.pdf", "application/pdf", stream);
}

Adding a two dimensional barcode to a PDF document

The below code snippet shows how to add a QR code using PdfQRBarcode class to the PDF document.

//Drawing QR Barcode

PdfQRBarcode barcode = new PdfQRBarcode();

//Set Error Correction Level

barcode.ErrorCorrectionLevel = PdfErrorCorrectionLevel.High;

//Set XDimension

barcode.XDimension = 3;

barcode.Text = "http://www.syncfusion.com";

//Creating new PDF Document

PdfDocument doc = new PdfDocument();

//Adding new page to PDF document

PdfPage page = doc.Pages.Add();

//Printing barcode on to the Pdf. 

barcode.Draw(page, new PointF(25, 70));

//Saving the Document

doc.Save("QRBarcode.pdf");
'Drawing QR Barcode

Dim barcode As New PdfQRBarcode()

'Set Error Correction Level

barcode.ErrorCorrectionLevel = PdfErrorCorrectionLevel.High

'Set XDimension

barcode.XDimension = 3

barcode.Text = "http://www.syncfusion.com"

'Creating new PDF Document

Dim doc As New PdfDocument()

'Adding new page to PDF document

Dim page As PdfPage = doc.Pages.Add()

'Printing barcode on to the Pdf. 

barcode.Draw(page, New PointF(25, 70))

'Saving the Document

doc.Save("QRBarcode.pdf")
//Drawing QR Barcode

PdfQRBarcode barcode = new PdfQRBarcode();

//Set Error Correction Level

barcode.ErrorCorrectionLevel = PdfErrorCorrectionLevel.High;

//Set XDimension

barcode.XDimension = 3;

barcode.Text = "http://www.syncfusion.com";

//Creating new PDF Document

PdfDocument doc = new PdfDocument();

//Adding new page to PDF document

PdfPage page = doc.Pages.Add();

//Printing barcode on to the Pdf. 

barcode.Draw(page, new PointF(25, 70));

//Save the PDF document to stream

MemoryStream stream = new MemoryStream();

await doc.SaveAsync(stream);

//Close the document

doc.Close(true);                                                                   

//Save the stream as PDF document file in local machine. Refer to PDF/UWP section for respected code samples

Save(stream, "output.pdf");
//Drawing QR Barcode

PdfQRBarcode barcode = new PdfQRBarcode();

//Set Error Correction Level

barcode.ErrorCorrectionLevel = PdfErrorCorrectionLevel.High;

//Set XDimension

barcode.XDimension = 3;

barcode.Text = "http://www.syncfusion.com";
barcode.Text = "http://www.syncfusion.com";

//Creating new PDF Document

PdfDocument doc = new PdfDocument();

//Adding new page to PDF document

PdfPage page = doc.Pages.Add();

//Printing barcode on to the Pdf. 

barcode.Draw(page, new PointF(25, 70));

//Save the document into stream.

MemoryStream stream = new MemoryStream();

doc.Save(stream);

stream.Position = 0;

//Close the documents.

doc.Close(true);

//Defining the ContentType for pdf file.

string contentType = "application/pdf";

//Define the file name.

string fileName = " QRBarcode.pdf";

//Creates a FileContentResult object by using the file contents, content type, and file name.

return File(stream, contentType, fileName);
//Drawing QR Barcode

PdfQRBarcode barcode = new PdfQRBarcode();

//Set Error Correction Level

barcode.ErrorCorrectionLevel = PdfErrorCorrectionLevel.High;

//Set XDimension

barcode.XDimension = 3;

barcode.Text = "http://www.syncfusion.com";

//Creating new PDF Document

PdfDocument doc = new PdfDocument();

//Adding new page to PDF document

PdfPage page = doc.Pages.Add();

//Printing barcode on to the Pdf. 

barcode.Draw(page, new PointF(25, 70));

//Save the PDF document to stream

MemoryStream stream = new MemoryStream();

doc.Save(stream);

//Closes the document

doc.Close(true);

//Save the stream into pdf file

//The operation in Save under Xamarin varies between Windows Phone, Android and iOS platforms. Please refer PDF/Xamarin section for respective code samples

if (Device.OS == TargetPlatform.WinPhone || Device.OS == TargetPlatform.Windows)
{
    Xamarin.Forms.DependencyService.Get<ISaveWindowsPhone>().Save("Output.pdf", "application/pdf", stream);
}
else
{
    Xamarin.Forms.DependencyService.Get<ISave>().Save("Output.pdf", "application/pdf", stream);
}

The below code snippet shows how to add a Pdf417 barcode code using Pdf417Barcode class to the PDF document.

//Creates a new Pdf417 Barcode.

Pdf417Barcode barcode = new Pdf417Barcode();

//Set error correction level.

barcode.ErrorCorrectionLevel= Pdf417ErrorCorrectionLevel.Auto;

//Set XDimension

barcode.XDimension = 2;

//Set the barcode text

barcode.Text = "http://www.syncfusion.com";

//Creating new PDF document.

PdfDocument document = new PdfDocument();

//Adding new page to PDF document.

PdfPage page = document.Pages.Add();

//Printing barcode on to the Pdf

barcode.Draw(page, new PointF(25,70));

//Saving the document.

document.Save("417Barcode.pdf");

//Close the document

document.Close(true);
'Creates a new Pdf417 Barcode.

Dim barcode As New Pdf417Barcode()

'Set error correction level.

barcode.ErrorCorrectionLevel = Pdf417ErrorCorrectionLevel.Auto

'Set XDimension

barcode.XDimension = 2

'Set the barcode text

barcode.Text = "http://www.syncfusion.com"

'Creating new PDF document.

Dim document As New PdfDocument()

'Adding new page to PDF document.

Dim page As PdfPage = document.Pages.Add()

'Printing barcode on to the Pdf

barcode.Draw(page, New PointF(25, 70))

'Saving the document.

document.Save("417Barcode.pdf")

'Close the document.

document.Close(True)
// Creates a new Pdf417 Barcode.

Pdf417Barcode barcode = new Pdf417Barcode();

//Set error correction level.

barcode.ErrorCorrectionLevel= Pdf417ErrorCorrectionLevel.Auto;

//Set XDimension

barcode.XDimension = 2;

//Set the barcode text

barcode.Text = "http://www.syncfusion.com";

//Creating new PDF document.

PdfDocument document = new PdfDocument();

//Adding new page to PDF document.

PdfPage page = document.Pages.Add();

//Printing barcode on to the Pdf

barcode.Draw(page, new PointF(25,70)); 
     
//Save the PDF document to stream 

MemoryStream stream = new MemorySteam(); 

document.Save(stream); 

//Close the document 

document.Close(true);
 
//Save the stream as a PDF document file in the local machine. Refer to the PDF or UWP section for the respected code samples

Save(stream, "417Barcode.pdf");
// Creates a new Pdf417 Barcode.

Pdf417Barcode barcode = new Pdf417Barcode();

//Set error correction level.

barcode.ErrorCorrectionLevel= Pdf417ErrorCorrectionLevel.Auto;

//Set XDimension

barcode.XDimension = 2;

//Set the barcode text

barcode.Text = "http://www.syncfusion.com";

//Creating new PDF document.

PdfDocument document = new PdfDocument();

//Adding new page to PDF document.

PdfPage page = document.Pages.Add();

//Printing barcode on to the Pdf

barcode.Draw(page, new PointF(25,70));

//Creating the stream object 

MemoryStream stream = new MemoryStream(); 

//Save the document into stream 

document.Save(stream); 

//If the position is not set to '0' then the PDF will be empty 

stream.Position = 0; 

//Close the document
 
document.Close(true); 

//Defining the ContentType for pdf file
 
string contentType = "application/pdf";
 
//Define the file name 

string fileName = "417Barcode.pdf"; 

//Creates a FileContentResult object by using the file contents, content type, and file name
 
return File(stream, contentType, fileName);
// Creates a new Pdf417 Barcode.

Pdf417Barcode barcode = new Pdf417Barcode();

//Set error correction level.

barcode.ErrorCorrectionLevel= Pdf417ErrorCorrectionLevel.Auto;

//Set XDimension

barcode.XDimension = 2;

barcode.Text = "http://www.syncfusion.com";

//Creating new PDF document.

PdfDocument document = new PdfDocument();

//Adding new page to PDF document.

PdfPage page = document.Pages.Add();

//Printing barcode on to the Pdf

barcode.Draw(page, new PointF(25,70));

//Save the PDF document to stream 

MemoryStream stream = new MemoryStream(); 

document.Save(stream);

//Close the document
 
document.Close(true); 

//Save the stream into pdf file
 
Xamarin.Forms.DependencyService.Get<ISave>().SaveAndView("417Barcode.pdf", "application/pdf", stream);

Set location and size to the barcode

The following code snippets show how to set Size and Location for Codabar barcode using PdfCodabarBarcode class to a PDF document.

//Creating new PDF Document

PdfDocument doc = new PdfDocument();

//Adding new page to PDF document

PdfPage page = doc.Pages.Add();

//Create new instance for Codabar barcode

PdfCodabarBarcode barcode = new PdfCodabarBarcode();

//Setting location of the barcode 

barcode.Location = new PointF(100, 100);

//Setting size of the barcode

barcode.Size = new SizeF(200, 100);

barcode.Text = "123456789$";

//Printing barcode on to the Pdf. 

barcode.Draw(page);

//Save and close the Document

doc.Save("CODABAR.pdf");

doc.Close(true);
'Creating new PDF Document

Dim doc As New PdfDocument()

'Adding new page to PDF document

Dim page As PdfPage = doc.Pages.Add()

'Create new instance for Codabar barcode

Dim barcode As PdfCodabarBarcode = New PdfCodabarBarcode()

'Setting location of the barcode 

barcode.Location = New PointF(100, 100)

'Setting size of the barcode

barcode.Size = New SizeF(200, 100)

barcode.Text = "123456789$"

'Printing barcode on to the Pdf. 

barcode.Draw(page)

'Save and close the Document

doc.Save("CODABAR.pdf")

doc.Close(True)
//Creating new PDF Document

PdfDocument doc = new PdfDocument();

//Adding new page to PDF document

PdfPage page = doc.Pages.Add();

//Create new instance for Codabar barcode

PdfCodabarBarcode barcode = new PdfCodabarBarcode();

//Setting location of the barcode 

barcode.Location = new PointF(100, 100);

//Setting size of the barcode

barcode.Size = new SizeF(200, 100);

barcode.Text = "123456789$";

//Printing barcode on to the Pdf. 

barcode.Draw(page);

//Save the PDF document to stream

MemoryStream stream = new MemoryStream();

await doc.SaveAsync(stream);

//Close the document

doc.Close(true);                                                                   

//Save the stream as PDF document file in local machine. Refer to PDF/UWP section for respected code samples

Save(stream, "output.pdf");
//Creating new PDF Document

PdfDocument doc = new PdfDocument();

//Adding new page to PDF document

PdfPage page = doc.Pages.Add();

//Create new instance for Codabar barcode

PdfCodabarBarcode barcode = new PdfCodabarBarcode();

//Setting location of the barcode 

barcode.Location = new PointF(100, 100);

//Setting size of the barcode

barcode.Size = new SizeF(200, 100);

barcode.Text = "123456789$";

//Printing barcode on to the Pdf. 

barcode.Draw(page);

//Save the document into stream.

MemoryStream stream = new MemoryStream();

doc.Save(stream);

stream.Position = 0;

//Close the documents.

doc.Close(true);

//Defining the ContentType for pdf file.

string contentType = "application/pdf";

//Define the file name.

string fileName = " CODABAR.pdf";

//Creates a FileContentResult object by using the file contents, content type, and file name.

return File(stream, contentType, fileName);
//Creating new PDF Document

PdfDocument doc = new PdfDocument();

//Adding new page to PDF document

PdfPage page = doc.Pages.Add();

//Create new instance for Codabar barcode

PdfCodabarBarcode barcode = new PdfCodabarBarcode();

//Setting location of the barcode 

barcode.Location = new PointF(100, 100);

//Setting size of the barcode

barcode.Size = new SizeF(200, 100);

barcode.Text = "123456789$";

//Printing barcode on to the Pdf. 

barcode.Draw(page);

//Save the PDF document to stream

MemoryStream stream = new MemoryStream();

doc.Save(stream);

//Closes the document

doc.Close(true);

//Save the stream into pdf file

//The operation in Save under Xamarin varies between Windows Phone, Android and iOS platforms. Please refer PDF/Xamarin section for respective code samples

if (Device.OS == TargetPlatform.WinPhone || Device.OS == TargetPlatform.Windows)
{
    Xamarin.Forms.DependencyService.Get<ISaveWindowsPhone>().Save("Output.pdf", "application/pdf", stream);
}
else
{
    Xamarin.Forms.DependencyService.Get<ISave>().Save("Output.pdf", "application/pdf", stream);
}

Adding a barcode to the PDF document without displaying the barcode text

The following code sample shows how to add a barcode to the PDF document without displaying the barcode text.

//Creating a new PDF Document 
PdfDocument doc = new PdfDocument();

//Adding a new page to the PDF document 
PdfPage page = doc.Pages.Add();

//Create a new instance for the Codabar barcode 
PdfCode39Barcode barcode = new PdfCode39Barcode();

//Set the barcode location
barcode.Location = new PointF(10, 10);

//Set the barcode text
barcode.Text = "123456789";

//Disable the barcode text  
barcode.TextDisplayLocation = TextLocation.None;

//Printing barcode on to the Pdf 
barcode.Draw(page);

//Save the PDF document
doc.Save("Output.pdf");

//Close the PDF document
doc.Close(true);
'Creating a new PDF Document 
Dim doc As PdfDocument = New PdfDocument()

'Adding a new page to the PDF document 
Dim page As PdfPage = doc.Pages.Add()

'Create a new instance for the Codabar barcode 
Dim barcode As PdfCode39Barcode = New PdfCode39Barcode()

'Set the barcode location
barcode.Location = New PointF(10, 10)

'Set the barcode text
barcode.Text = "123456789"

'Disable the barcode text  
barcode.TextDisplayLocation = TextLocation.None

'Printing barcode on to the Pdf 
barcode.Draw(page)

'Save the PDF document 
doc.Save("Output.pdf")

'Close the PDF document
doc.Close(True)
//Creating a new PDF Document 
PdfDocument doc = new PdfDocument();

//Adding a new page to the PDF document 
PdfPage page = doc.Pages.Add();

//Create a new instance for the Codabar barcode 
PdfCode39Barcode barcode = new PdfCode39Barcode();

//Set the barcode location
barcode.Location = new PointF(10, 10);

//Set the barcode text
barcode.Text = "123456789";

//Disable the barcode text  
barcode.TextDisplayLocation = TextLocation.None;

//Printing barcode on to the Pdf 
barcode.Draw(page);

//Save the document
MemoryStream stream = new MemoryStream();
document.Save(stream);

//Close the PDF document
document.Close(true);

//Save the stream as a PDF document file in the local machine. Refer to the PDF or UWP section for the respected code samples
Save(stream, "Output.pdf");
//Creating new PDF Document 
PdfDocument doc = new PdfDocument();

//Adding a new page to the PDF document 
PdfPage page = doc.Pages.Add();

//Create a new instance for the Codabar barcode 
PdfCode39Barcode barcode = new PdfCode39Barcode();

//Set the barcode location
barcode.Location = new PointF(10, 10);

//Set the barcode text
barcode.Text = "123456789";

//Disable the barcode text  
barcode.TextDisplayLocation = TextLocation.None;

//Printing barcode on to the Pdf 
barcode.Draw(page);

//Creating the stream object
MemoryStream stream = new MemoryStream();

//Save the document into stream
doc.Save(stream);

//If the position is not set to '0' then the PDF will be empty
stream.Position = 0;

//Close the document
doc.Close(true);

//Defining the ContentType for pdf file
string contentType = "application/pdf";

//Define the file name
string fileName = "Output.pdf";

//Creates a FileContentResult object by using the file contents, content type, and file name
return File(stream, contentType, fileName);
//Creating a new PDF Document 
PdfDocument doc = new PdfDocument();

//Adding a new page to the PDF document 
PdfPage page = doc.Pages.Add();

//Create a new instance for the Codabar barcode 
PdfCode39Barcode barcode = new PdfCode39Barcode();

//Set the barcode location
barcode.Location = new PointF(10, 10);

//Set the barcode text
barcode.Text = "123456789";

//Disable the barcode text  
barcode.TextDisplayLocation = TextLocation.None;

//Printing barcode on to the Pdf 
barcode.Draw(page);

//Save the document to the stream
MemoryStream stream = new MemoryStream();
doc.Save(stream);

//Close the document
doc.Close(true);

stream.Position = 0;

//Save the stream into a pdf file

//The operation in Save under Xamarin varies between Windows Phone, Android, and iOS platforms. Please refer PDF/Xamarin section for respective code samples

if (Device.OS == TargetPlatform.WinPhone || Device.OS == TargetPlatform.Windows)
{
    Xamarin.Forms.DependencyService.Get<ISaveWindowsPhone>().Save("Output.pdf", "application/pdf", stream);
}
else
{
    Xamarin.Forms.DependencyService.Get<ISave>().Save("Output.pdf", "application/pdf", stream);
}

Export Barcode as Image

Essential PDF supports converting one dimensional barcodes such as Code 39, Code 39 Extended, Code 11, Codabar, Code 32, Code 93, Code 93 Extended, Code 128A, Code 128B, UPC bar code, and Code 128C barcodes to image using the ToImage method of PdfUnidimensionalBarcode instance.

NOTE

To export barcode as image in .NET Core, the following assembly should be referenced in your application Syncfusion.Pdf.Imaging.Portable .

The following code snippet explains this.

//Initialize a new PdfCode39Barcode instance
PdfCode39Barcode barcode = new PdfCode39Barcode();

//Set the height and text for barcode
barcode.BarHeight = 45;
barcode.Text = "CODE39$";

//Convert the barcode to image
Image barcodeImage = barcode.ToImage(new SizeF(300, 200));

//Save the image
barcodeImage.Save("Image.png", ImageFormat.Png);
'Initialize a new PdfCode39Barcode instance
Dim barcode As PdfCode39Barcode = New PdfCode39Barcode

'Set the height and text for barcode
barcode.BarHeight = 45
barcode.Text = "CODE39$"

'Convert the barcode to image
Dim barcodeImage As Image = barcode.ToImage(New SizeF(300, 200))

'Save the image
barcodeImage.Save("Image.png", ImageFormat.Png)
//PDF supports conversion of Barcode to Image only in Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms.
//Initialize a new PdfCode39Barcode instance
 PdfCode39Barcode barcode = new PdfCode39Barcode();

//Set the height and text for barcode
 barcode.BarHeight = 45;

 barcode.Text = "CODE39$";

//Convert the barcode to image
 Image barcodeImage = barcode.ToImage(new SizeF(300,200)); 

using (MemoryStream stream = new MemoryStream())
 {
    //Save image to stream.
     barcodeImage.Save(stream, ImageFormat.Png);
 }
//PDF supports conversion of Barcode to Image only in Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms.

Essential PDF supports converting two-dimensional barcodes such as QR Code and Data Matrix barcode to image. The following code snippet explains how to convert a QR code to image using the ToImage method of PdfQRBarcode instance.

//Initialize a new PdfQRBarcode instance
PdfQRBarcode barcode = new PdfQRBarcode();

//Set the XDimension and text for barcode
barcode.XDimension = 3;
barcode.Text = "http://www.google.com";

//Convert the barcode to image
Image barcodeImage = barcode.ToImage(new SizeF(300, 300));

//Save the image
barcodeImage.Save("Image.png", ImageFormat.Png);
'Initialize a new PdfQRBarcode instance
Dim barcode As PdfQRBarcode = New PdfQRBarcode

'Set the XDimension and text for barcode
barcode.XDimension = 3
barcode.Text = "http://www.google.com"

'Convert the barcode to image
Dim barcodeImage As Image = barcode.ToImage(New SizeF(300, 300))

'Save the image
barcodeImage.Save("Image.jpg", ImageFormat.Png)
//PDF supports conversion of Barcode to Image only in Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms.
//Initialize a new PdfQRBarcode instance 
PdfQRBarcode barcode = new PdfQRBarcode();

//Set the XDimension and text for barcode 
barcode.XDimension = 3;
barcode.Text = "http://www.google.com";
         
//Convert the barcode to image 
Image barcodeImage = barcode.ToImage(new SizeF(300, 300));

 using (MemoryStream stream = new MemoryStream())
 {
    //Save image to stream.
    barcodeImage.Save(stream, ImageFormat.Png);
 }
//PDF supports conversion of Barcode to Image only in Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms.

Customizing the barcode appearance

The height of the barcode can be changed using the BarHeight property. The equivalent property to change the block size for two dimensional barcode is XDimension. You can also customize the barcode color by changing the DarkBarColor and LightBarColor properties.

NOTE

This color customization is possible only for one dimensional barcodes and it is not supported for two dimensional barcodes.

Supported barcode types

The following table contains the supported types and associated valid characters.

Symbol

Supported characters

Length

QR Code



[0–9]; [A–Z (upper-case only)]; [space $ % * + - . / , :]; [Shift JIS characters]

variable

DataMatrix



All ASCII characters



Code 39



[0-9]; [A-Z]; [- . $ / + % SPACE]

variable

Code 39 Extended



[0-9]; [A-Z]; [a-z]

variable

Code 11



[0-9]; [-]

variable

Codabar



[0-9]; [- $ : / . +]

variable

Code 32

[0-9]

8

Code 93



[0-9]; [A-Z]; [- . $ / + % SPACE]

variable

Code 93 Extended



All 128 ASCII characters

variable

Code 128A



[0-9]; [A-Z]; [NUL (0x00) SOH (0x01) STX (0x02) ETX (0x03) EOT(0x04) ENQ (0x05) ACK (0x06) BEL (0x07) BS (0x08) HT (0x09) LF (0x0A) VT(0x0B) FF (0x0C) CR (0x0D) SO (0x0E) SI (0x0F) DLE (0x10) DC1 (0x11) DC2(0x12) DC3 (0x13) DC4 (0x14) NAK (0x15) SYN (0x16) ETB (0x17) CAN(0x18) EM (0x19) SUB (0x1A) ESC (0x1B) FS (0x1C) GS (0x1D) RS (0x1E) US(0x1F) SPACE (0x20)]; [" ! # $ % & ' ( ) * + , - . / ; < = > ? @ [ / ]^ _ ]

variable

Code 128B



[0-9]; [A-Z]; [a-z]; [SPACE (0x20) ! " # $ % & ' ( ) * + , - . / :; < = > ? @ [ / ]^ _ ` { | } ~ DEL (•) ]

variable

Code 128C



ASCII 00-99(encodes each two digit with one code)

variable

Pdf417



[0-9]; [A-Z]; [a-z]; Mixed; Punctuation; Byte

variable