Class PdfCode32Barcode
Inherited Members
Namespace: Syncfusion.Pdf.Barcode
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public class PdfCode32Barcode : PdfCode39Barcode
Remarks
Only the following symbols are allowed in a Code 32 barcode: 1 2 3 4 5 6 7 8 9 0. The barcode length is 9 digits (8 user defined digits + 1 check digit). Code 32 barcodes are also known as Italian Pharmacode barcodes.
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 PdfCode32Barcode.
PdfCode32Barcode code32 = new PdfCode32Barcode();
//Set the font to code32.
code32.Font = font;
//Set the barcode text.
code32.Text = "01234567";
//Draw a barcode in the new Page.
code32.Draw(page, new PointF(25, 500));
//Save the document to disk.
document.Save("Code32.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 PdfCode32Barcode.
Dim code32 As PdfCode32Barcode = New PdfCode32Barcode()
'Set the font to code32.
code32.Font = font
'Set the barcode text.
code32.Text = "01234567"
'Draw a barcode in the new Page.
code32.Draw(page, new PointF(25, 500))
'Save the document to disk.
document.Save("Code32.pdf")
Constructors
PdfCode32Barcode()
Initializes a new instance of the PdfCode32Barcode class.
Declaration
public PdfCode32Barcode()
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 PdfCode32Barcode.
PdfCode32Barcode code32 = new PdfCode32Barcode();
//Set the font to code32.
code32.Font = font;
//Set the barcode text.
code32.Text = "01234567";
//Draw a barcode in the new Page.
code32.Draw(page, new PointF(25, 500));
//Save the document to disk.
document.Save("Code32.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 PdfCode32Barcode.
Dim code32 As PdfCode32Barcode = New PdfCode32Barcode()
'Set the font to code32.
code32.Font = font
'Set the barcode text.
code32.Text = "01234567"
'Draw a barcode in the new Page.
code32.Draw(page, new PointF(25, 500))
'Save the document to disk.
document.Save("Code32.pdf")
PdfCode32Barcode(String)
Initializes a new instance of the PdfCode32Barcode class.
Declaration
public PdfCode32Barcode(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 PdfCode32Barcode.
PdfCode32Barcode code32 = new PdfCode32Barcode("01234567");
//Set the font to code32.
code32.Font = font;
//Draw a barcode in the new Page.
code32.Draw(page, new PointF(25, 500));
//Save the document to disk.
document.Save("Code32.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 PdfCode32Barcode.
Dim code32 As PdfCode32Barcode = New PdfCode32Barcode("01234567")
'Set the font to code32.
code32.Font = font
'Draw a barcode in the new Page.
code32.Draw(page, new PointF(25, 500))
'Save the document to disk.
document.Save("Code32.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
GetDataToEncode(String)
To get the Actual Encoded Text from from original Text..
Declaration
protected string GetDataToEncode(string originalData)
Parameters
Type | Name | Description |
---|---|---|
System.String | originalData | The original data. |
Returns
Type | Description |
---|---|
System.String | original Data |
ObtainBarcodeSymbols()
Gets the barcode symbols.
Declaration
protected string ObtainBarcodeSymbols()
Returns
Type | Description |
---|---|
System.String | Encoded data |