Class PdfCode39Barcode
Inheritance
System.Object
PdfCode39Barcode
Inherited Members
Namespace: Syncfusion.Pdf.Barcode
Assembly: Syncfusion.Pdf.Portable.dll
Syntax
public class PdfCode39Barcode : PdfUnidimensionalBarcode
Remarks
Only the following symbols are allowed in a Code 39 barcode:Only the following symbols are allowed in a Code 39 barcode: 1 2 3 4 5 6 7 8 9 0 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 - . $ / + % SPACE All alphabetic characters are uppercase. If lowercase characters are required, then a Code 39 Extended barcode must be used.
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 PdfCode39Barcode.
PdfCode39Barcode code39 = new PdfCode39Barcode();
//Set the font to code39.
code32.Font = font;
//Set the barcode text.
code39.Text = "CODE39";
//Draw a barcode in the new Page.
code39.Draw(page, new PointF(25, 500));
//Save the document to disk.
document.Save("Code39.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 PdfCode39Barcode.
Dim code39 As PdfCode39Barcode = New PdfCode39Barcode()
'Set the font to code39.
code39.Font = font
'Set the barcode text.
code39.Text = "CODE39"
'Draw a barcode in the new Page.
code39.Draw(page, new PointF(25, 500))
'Save the document to disk.
document.Save("Code39.pdf")
Constructors
PdfCode39Barcode()
Initializes a new instance of the PdfCode39Barcode class.
Declaration
public PdfCode39Barcode()
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 PdfCode39Barcode.
PdfCode39Barcode code39 = new PdfCode39Barcode();
//Set the font to code39.
code32.Font = font;
//Set the barcode text.
code39.Text = "CODE39";
//Draw a barcode in the new Page.
code39.Draw(page, new PointF(25, 500));
//Save the document to disk.
document.Save("Code39.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 PdfCode39Barcode.
Dim code39 As PdfCode39Barcode = New PdfCode39Barcode()
'Set the font to code39.
code39.Font = font
'Set the barcode text.
code39.Text = "CODE39"
'Draw a barcode in the new Page.
code39.Draw(page, new PointF(25, 500))
'Save the document to disk.
document.Save("Code39.pdf")
PdfCode39Barcode(String)
Initializes a new instance of the PdfCode39Barcode class.
Declaration
public PdfCode39Barcode(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 PdfCode39Barcode.
PdfCode39Barcode code39 = new PdfCode39Barcode("CODE39");
//Set the font to code39.
code32.Font = font;
//Draw a barcode in the new Page.
code39.Draw(page, new PointF(25, 500));
//Save the document to disk.
document.Save("Code39.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 PdfCode39Barcode.
Dim code39 As PdfCode39Barcode = New PdfCode39Barcode("CODE39")
'Set the font to code39.
code39.Font = font
'Draw a barcode in the new Page.
code39.Draw(page, new PointF(25, 500))
'Save the document to disk.
document.Save("Code39.pdf")
Methods
CalculateCheckDigit()
Internal method to calculate the check-digit
Declaration
protected override char[] CalculateCheckDigit()
Returns
Type |
---|
System.Char[] |