menu

Document Processing

PdfCode128CBarcode Class - C# PDF Library API Reference | Syncfusion

    Show / Hide Table of Contents

    PdfCode128CBarcode Class

    Inheritance
    System.Object
    PdfBarcode
    PdfUnidimensionalBarcode
    PdfCode128CBarcode
    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)
    Namespace: Syncfusion.Pdf.Barcode
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfCode128CBarcode : PdfUnidimensionalBarcode
    Remarks

    Only the following symbols are allowed in a Code 128C barcode: 0 1 2 3 4 5 6 7 8 9 FNC1 (\xF0). Code 128 C encodes only numeric symbols at double density, each pair of digits is encoded using a single symbol.

    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 PdfCode128CBarcode.
    PdfCode128CBarcode code128C = new PdfCode128CBarcode();
    //Set the font to code128C.
    code128C.Font = font;
    //Set the barcode text.
    code128C.Text = "Code128C";
    //Draw a barcode in the new Page.
    code128C.Draw(page, new PointF(25, 500));
    //Save the  document to disk.
    document.Save("Code128C.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 PdfCode128CBarcode.
    Dim code128C As PdfCode128CBarcode = New PdfCode128CBarcode()
    'Set the font to code128C.
    code128C.Font = font
    'Set the barcode text.
    code128C.Text = "Code128C"
    'Draw a barcode in the new Page.
    code128C.Draw(page, new PointF(25, 500))
    'Save the  document to disk.
    document.Save("Code128C.pdf")

    Constructors

    PdfCode128CBarcode()

    Initializes a new instance of the PdfCode128CBarcode class.

    Declaration
    public PdfCode128CBarcode()
    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 PdfCode128CBarcode.
    PdfCode128CBarcode code128C = new PdfCode128CBarcode();
    //Set the font to code128C.
    code128C.Font = font;
    //Set the barcode text.
    code128C.Text = "Code128C";
    //Draw a barcode in the new Page.
    code128C.Draw(page, new PointF(25, 500));
    //Save the  document to disk.
    document.Save("Code128C.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 PdfCode128CBarcode.
    Dim code128C As PdfCode128CBarcode = New PdfCode128CBarcode()
    'Set the font to code128C.
    code128C.Font = font
    'Set the barcode text.
    code128C.Text = "Code128C"
    'Draw a barcode in the new Page.
    code128C.Draw(page, new PointF(25, 500))
    'Save the  document to disk.
    document.Save("Code128C.pdf")

    PdfCode128CBarcode(String)

    Initializes a new instance of the PdfCode128CBarcode class.

    Declaration
    public PdfCode128CBarcode(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 PdfCode128CBarcode.
    PdfCode128CBarcode code128C = new PdfCode128CBarcode("Code128C");
    //Set the font to code128C.
    code128C.Font = font;
    //Draw a barcode in the new Page.
    code128C.Draw(page, new PointF(25, 500));
    //Save the  document to disk.
    document.Save("Code128C.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 PdfCode128CBarcode.
    Dim code128C As PdfCode128CBarcode = New PdfCode128CBarcode("Code128C")
    'Set the font to code128C.
    code128C.Font = font
    'Draw a barcode in the new Page.
    code128C.Draw(page, new PointF(25, 500))
    'Save the  document to disk.
    document.Save("Code128C.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
    PdfUnidimensionalBarcode.CalculateCheckDigit()

    GetDataToEncode(String)

    Gets the data to encode.

    Declaration
    protected string GetDataToEncode(string originalData)
    Parameters
    Type Name Description
    System.String originalData

    The original data.

    Returns
    Type Description
    System.String

    Encoded string.

    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.

    Overrides
    PdfUnidimensionalBarcode.Validate(String)

    See Also

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