Class PdfCodabarBarcode
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Syncfusion.Pdf.Barcode
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfCodabarBarcode : PdfUnidimensionalBarcode
Remarks
This symbology allows the encoding of strings of up to 16 digits, 10 numeric digits (0 through 9) and 6 special non alpha characters ("+", "-", "$", "/", ":", ".").
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Creates a new PdfCodabarBarcode.
PdfCodabarBarcode codaBarcode = new PdfCodabarBarcode();
//Set the font to codabarcode.
codaBarcode.Font = font;
//Set the barcode text.
codaBarcode.Text = "0123";
//Draw a barcode in the new Page.
codaBarcode.Draw(page, new PointF(25, 500));
//Save the document to disk.
document.Save("CodaBarcode.pdf");
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Create font and font style.
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold)
'Creates a new PdfCodabarBarcode.
Dim codaBarcode As PdfCodabarBarcode = New PdfCodabarBarcode()
'Set the font..
codaBarcode.Font = font
'Set the barcode text.
codaBarcode.Text = "0123"
'Draw a barcode in the new Page.
codaBarcode.Draw(page, new PointF(25, 500))
'Save the document to disk.
document.Save("CodaBarcode.pdf")
Constructors
PdfCodabarBarcode()
Initializes a new instance of the PdfCodabarBarcode class.
Declaration
public PdfCodabarBarcode()
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Creates a new PdfCodabarBarcode.
PdfCodabarBarcode codaBarcode = new PdfCodabarBarcode();
//Set the font to codabarcode.
codaBarcode.Font = font;
//Set the barcode text.
codaBarcode.Text = "0123";
//Draw a barcode in the new Page.
codaBarcode.Draw(page, new PointF(25, 500));
//Save the document to disk.
document.Save("CodaBarcode.pdf");
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Create font and font style.
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold)
'Creates a new PdfCodabarBarcode.
Dim codaBarcode As PdfCodabarBarcode = New PdfCodabarBarcode()
'Set the font..
codaBarcode.Font = font
'Set the barcode text.
codaBarcode.Text = "0123"
'Draw a barcode in the new Page.
codaBarcode.Draw(page, new PointF(25, 500))
'Save the document to disk.
document.Save("CodaBarcode.pdf")
PdfCodabarBarcode(String)
Initializes a new instance of the PdfCodabarBarcode class.
Declaration
public PdfCodabarBarcode(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The Barcode Text. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Creates a new PdfCodabarBarcode.
PdfCodabarBarcode codaBarcode = new PdfCodabarBarcode("0123");
//Set the font to codabarcode.
codaBarcode.Font = font;
//Draw a barcode in the new Page.
codaBarcode.Draw(page, new PointF(25, 500));
//Save the document to disk.
document.Save("CodaBarcode.pdf");
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Create font and font style.
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold)
'Creates a new PdfCodabarBarcode.
Dim codaBarcode As PdfCodabarBarcode = New PdfCodabarBarcode("0123")
'Set the font..
codaBarcode.Font = font
'Draw a barcode in the new Page.
codaBarcode.Draw(page, new PointF(25, 500))
'Save the document to disk.
document.Save("CodaBarcode.pdf")