Class PdfCode11Barcode
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Syncfusion.Pdf.Barcode
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfCode11Barcode : PdfUnidimensionalBarcode
Remarks
Only the following symbols are allowed in a Code 11 barcode: 0 1 2 3 4 5 6 7 8 9 -
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 pdfFont and pdfFont style.
PdfFont pdfFont = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Creates a new PdfCode11Barcode.
PdfCode11Barcode code11 = new PdfCode11Barcode();
//Set the pdffont to code11 barcode.
code11.Font = pdfFont;
//Set the barcode text.
code11.Text = "012345678";
//Draw a barcode in the new Page.
code11.Draw(page, new PointF(25, 500));
//Save the document to disk.
document.Save("Code11.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 pdfFont and pdfFont style.
Dim pdfFont As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold)
'Creates a new PdfCode11Barcode.
Dim code11 As PdfCode11Barcode = New PdfCode11Barcode()
'Set the pdffont to code11 barcode.
code11.Font = pdfFont;
'Set the barcode text.
code11.Text = "012345678"
'Draw a barcode in the new Page.
code11.Draw(page, new PointF(25, 500))
'Save the document to disk.
document.Save("Code11.pdf")
Constructors
PdfCode11Barcode()
Initializes a new instance of the PdfCode11Barcode class.
Declaration
public PdfCode11Barcode()
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 pdfFont and pdfFont style.
PdfFont pdfFont = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Creates a new PdfCode11Barcode.
PdfCode11Barcode code11 = new PdfCode11Barcode();
//Set the pdffont to code11 barcode.
code11.Font = pdfFont;
//Set the barcode text.
code11.Text = "012345678";
//Draw a barcode in the new Page.
code11.Draw(page, new PointF(25, 500));
//Save the document to disk.
document.Save("Code11.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 pdfFont and pdfFont style.
Dim pdfFont As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold)
'Creates a new PdfCode11Barcode.
Dim code11 As PdfCode11Barcode = New PdfCode11Barcode()
'Set the pdffont to code11 barcode.
code11.Font = pdfFont;
'Set the barcode text.
code11.Text = "012345678"
'Draw a barcode in the new Page.
code11.Draw(page, new PointF(25, 500))
'Save the document to disk.
document.Save("Code11.pdf")
PdfCode11Barcode(String)
Initializes a new instance of the PdfCode11Barcode class.
Declaration
public PdfCode11Barcode(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 pdfFont and pdfFont style.
PdfFont pdfFont = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Creates a new PdfCode11Barcode.
PdfCode11Barcode code11 = new PdfCode11Barcode("012345678");
//Set the pdffont to code11 barcode.
code11.Font = pdfFont;
//Draw a barcode in the new Page.
code11.Draw(page, new PointF(25, 500));
//Save the document to disk.
document.Save("Code11.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 pdfFont and pdfFont style.
Dim pdfFont As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold)
'Creates a new PdfCode11Barcode.
Dim code11 As PdfCode11Barcode = New PdfCode11Barcode("012345678")
'Set the pdffont to code11 barcode.
code11.Font = pdfFont
'Draw a barcode in the new Page.
code11.Draw(page, new PointF(25, 500))
'Save the document to disk.
document.Save("Code11.pdf")
Methods
CalculateCheckDigit()
Calculates the check digit for this barcode specification.
Declaration
protected override char[] CalculateCheckDigit()
Returns
Type | Description |
---|---|
System.Char[] | The Check digits. |