menu

Document Processing

PdfCode39Barcode Class - C# PDF Library API Reference | Syncfusion

    Show / Hide Table of Contents

    PdfCode39Barcode Class

    Inheritance
    System.Object
    PdfBarcode
    PdfUnidimensionalBarcode
    PdfCode39Barcode
    PdfCode32Barcode
    PdfCode39ExtendedBarcode
    Inherited Members
    PdfBarcode.BackColor
    PdfBarcode.BarColor
    PdfBarcode.barHeight
    PdfBarcode.BarHeight
    PdfBarcode.bounds
    PdfBarcode.Bounds
    PdfBarcode.Location
    PdfBarcode.NarrowBarWidth
    PdfBarcode.QuietZone
    PdfBarcode.size
    PdfBarcode.Size
    PdfBarcode.Text
    PdfBarcode.TextColor
    PdfUnidimensionalBarcode.BarcodeToTextGapHeight
    PdfUnidimensionalBarcode.check
    PdfUnidimensionalBarcode.Draw(PdfGraphics)
    PdfUnidimensionalBarcode.Draw(PdfGraphics, PointF)
    PdfUnidimensionalBarcode.Draw(PdfGraphics, PointF, SizeF)
    PdfUnidimensionalBarcode.Draw(PdfGraphics, RectangleF)
    PdfUnidimensionalBarcode.Draw(PdfGraphics, Single, Single, Single, Single)
    PdfUnidimensionalBarcode.Draw(PdfPageBase)
    PdfUnidimensionalBarcode.Draw(PdfPageBase, PointF)
    PdfUnidimensionalBarcode.Draw(PdfPageBase, PointF, SizeF)
    PdfUnidimensionalBarcode.Draw(PdfPageBase, RectangleF)
    PdfUnidimensionalBarcode.Draw(PdfPageBase, Single, Single, Single, Single)
    PdfUnidimensionalBarcode.EnableCheckDigit
    PdfUnidimensionalBarcode.EncodeStartStopSymbols
    PdfUnidimensionalBarcode.Font
    PdfUnidimensionalBarcode.GetExtendedTextValue()
    PdfUnidimensionalBarcode.GetSizeValue()
    PdfUnidimensionalBarcode.PaintRectangle(PdfGraphics, RectangleF)
    PdfUnidimensionalBarcode.PaintRectangle(PdfPageBase, RectangleF)
    PdfUnidimensionalBarcode.PaintRectangleTag(PdfTemplate, RectangleF)
    PdfUnidimensionalBarcode.ShowCheckDigit
    PdfUnidimensionalBarcode.TextAlignment
    PdfUnidimensionalBarcode.TextDisplayLocation
    PdfUnidimensionalBarcode.ToImage()
    PdfUnidimensionalBarcode.ToImage(SizeF)
    PdfUnidimensionalBarcode.Validate(String)
    Namespace: Syncfusion.Pdf.Barcode
    Assembly: Syncfusion.Pdf.Base.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[]
    Overrides
    PdfUnidimensionalBarcode.CalculateCheckDigit()

    See Also

    PdfCodabarBarcode
    PdfCode11Barcode
    PdfCode128ABarcode
    PdfCode128BBarcode
    PdfCode128CBarcode
    PdfCode32Barcode
    PdfCode39ExtendedBarcode
    PdfCode93Barcode
    PdfCode93ExtendedBarcode
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved