menu

Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfCodeUpcBarcode - Xamarin.Android API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfCodeUpcBarcode

    Inheritance
    System.Object
    PdfBarcode
    PdfUnidimensionalBarcode
    PdfCodeUpcBarcode
    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.Validate(String)
    Namespace: Syncfusion.Pdf.Barcode
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public class PdfCodeUpcBarcode : PdfUnidimensionalBarcode
    Remarks

    Only the following symbols are allowed in a UPC-A barcode: 0 1 2 3 4 5 6 7 8 9 B.

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

    Constructors

    PdfCodeUpcBarcode()

    Initializes a new instance of the PdfCodeUpcBarcode class.

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

    PdfCodeUpcBarcode(String)

    Initializes a new instance of the PdfCodeUpcBarcode class.

    Declaration
    public PdfCodeUpcBarcode(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 PdfCodeUPCBarcode.
    PdfCodeUpcBarcode upcbarcode = new PdfCodeUpcBarcode("UPC");
    //Set the font to upc.
    upcbarcode.Font = font;
    //Draw a barcode in the new Page.
    upcbarcode.Draw(page, new PointF(25, 500));
    //Save the  document to disk.
    document.Save("UPC.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 PdfCodeUPCBarcode.
    Dim code32 As PdfCodeUpcBarcode = New PdfCodeUpcBarcode("UPC")
    'Set the font to upc.
    upcbarcode.Font = font;
    'Draw a barcode in the new Page.
    upcbarcode.Draw(page, new PointF(25, 500))
    'Save the  document to disk.
    document.Save("UPC.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()

    Extension Methods

    PdfBarcodeExtension.ToImage(PdfUnidimensionalBarcode)
    PdfBarcodeExtension.ToImage(PdfUnidimensionalBarcode, SizeF)

    See Also

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