Class PdfCode128ABarcode
Inherited Members
Namespace: Syncfusion.Pdf.Barcode
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfCode128ABarcode : PdfUnidimensionalBarcode
Remarks
Only the following symbols are allowed in a Code 128 A barcode: NUL (\x00) SOH (\x01) STX (\x02) ETX (\x03) EOT (\x04) ENQ (\x05) ACK (\x06) BEL (\x07) BS (\x08) HT (\x09) LF (\x0A) VT (\x0B) FF (\x0C) CR (\x0D) SO (\x0E) SI (\x0F) DLE (\x10) DC1 (\x11) DC2 (\x12) DC3 (\x13) DC4 (\x14) NAK (\x15) SYN (\x16) ETB (\x17) CAN (\x18) EM (\x19) SUB (\x1A) ESC (\x1B) FS (\x1C) GS (\x1D) RS (\x1E) US (\x1F) SPACE ! # $ % ' * + , - . 0 1 2 3 4 5 6 7 8 9 : ; ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ]^ _ FNC1 (\xF0) FNC2 (\xF1) FNC3 (\xF2) FNC4
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 PdfCode128ABarcode.
PdfCode128ABarcode code128A = new PdfCode128ABarcode();
//Set the font to code128A.
code128A.Font = font;
//Set the barcode text.
code128A.Text = "CODE128A";
//Draw a barcode in the new Page.
code128A.Draw(page, new PointF(25, 500));
//Save the document to disk.
document.Save("Code128A.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 PdfCode128ABarcode.
Dim code32 As PdfCode128ABarcode = New PdfCode128ABarcode()
'Set the font to code128A.
code128A.Font = font
'Set the barcode text.
code128A.Text = "Code128A"
'Draw a barcode in the new Page.
code128A.Draw(page, new PointF(25, 500))
'Save the document to disk.
document.Save("Code128A.pdf")
Constructors
PdfCode128ABarcode()
Initializes a new instance of the PdfCode128ABarcode class.
Declaration
public PdfCode128ABarcode()
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 PdfCode128ABarcode.
PdfCode128ABarcode code128A = new PdfCode128ABarcode();
//Set the font to code128A.
code128A.Font = font;
//Set the barcode text.
code128A.Text = "CODE128A";
//Draw a barcode in the new Page.
code128A.Draw(page, new PointF(25, 500));
//Save the document to disk.
document.Save("Code128A.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 PdfCode128ABarcode.
Dim code32 As PdfCode128ABarcode = New PdfCode128ABarcode()
'Set the font to code128A.
code128A.Font = font
'Set the barcode text.
code128A.Text = "Code128A"
'Draw a barcode in the new Page.
code128A.Draw(page, new PointF(25, 500))
'Save the document to disk.
document.Save("Code128A.pdf")
PdfCode128ABarcode(String)
Initializes a new instance of the PdfCode128ABarcode class.
Declaration
public PdfCode128ABarcode(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 PdfCode128ABarcode.
PdfCode128ABarcode code128A = new PdfCode128ABarcode("Code128A");
//Set the font to code128A.
code128A.Font = font;
//Draw a barcode in the new Page.
code128A.Draw(page, new PointF(25, 500));
//Save the document to disk.
document.Save("Code128A.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 PdfCode128ABarcode.
Dim code32 As PdfCode128ABarcode = New PdfCode128ABarcode("Code128A")
'Set the font to code128A.
code128A.Font = font
'Draw a barcode in the new Page.
code128A.Draw(page, new PointF(25, 500))
'Save the document to disk.
document.Save("Code128A.pdf")
Methods
CalculateCheckDigit()
Calculates the check digit for this barcode specification.
Declaration
protected override char[] CalculateCheckDigit()
Returns
Type | Description |
---|---|
System.Char[] | The Check digits. |
Overrides
Initialize()
Initializes the internal barcode symbol table
Declaration
protected void Initialize()
Validate(String)
Internal method used to validate the given barcode text.
Declaration
protected override bool Validate(string data)
Parameters
Type | Name | Description |
---|---|---|
System.String | data | The Text. |
Returns
Type | Description |
---|---|
System.Boolean | True if valid, Otherwise False. |