WPF

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfEan13Barcode - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfEan13Barcode

    Represents the PdfEan13 barcode.

    Inheritance
    System.Object
    PdfBarcode
    PdfUnidimensionalBarcode
    PdfEan13Barcode
    Inherited Members
    PdfUnidimensionalBarcode.check
    PdfUnidimensionalBarcode.Validate(String)
    PdfUnidimensionalBarcode.GetSizeValue()
    PdfUnidimensionalBarcode.GetExtendedTextValue()
    PdfUnidimensionalBarcode.CalculateCheckDigit()
    PdfUnidimensionalBarcode.GetTextToEncodeList()
    PdfUnidimensionalBarcode.PaintRectangle(PdfPageBase, RectangleF)
    PdfUnidimensionalBarcode.Font
    PdfUnidimensionalBarcode.TextDisplayLocation
    PdfUnidimensionalBarcode.ShowCheckDigit
    PdfUnidimensionalBarcode.EnableCheckDigit
    PdfUnidimensionalBarcode.BarcodeToTextGapHeight
    PdfUnidimensionalBarcode.TextAlignment
    PdfUnidimensionalBarcode.EncodeStartStopSymbols
    PdfBarcode.bounds
    PdfBarcode.size
    PdfBarcode.barHeight
    PdfBarcode.barHeightEnabled
    PdfBarcode.BackColor
    PdfBarcode.BarColor
    PdfBarcode.TextColor
    PdfBarcode.NarrowBarWidth
    PdfBarcode.Text
    PdfBarcode.Location
    PdfBarcode.QuietZone
    PdfBarcode.BarHeight
    PdfBarcode.Size
    PdfBarcode.Bounds
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Pdf.Barcode
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfEan13Barcode : PdfUnidimensionalBarcode
    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 PdfEan13Barcode.
    PdfEan13Barcode barcode = new PdfEan13Barcode();
    //Set the barcode text.
    barcode.Text = "4006381333931";
    barcode.Location = new PointF(100,100);
    //Draw a barcode in the new Page.
    barcode.Draw(page);
    //Save the  document to disk.
    document.Save("Ean13Barcode.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()
    'Creates a new PdfEan13Barcode.
    Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
    'Set the barcode text.
    barcode.Text = "4006381333931"
    barcode.Location = new PointF(100,100);
    'Draw a barcode in the new Page.
    barcode.Draw(page)
    'Save the  document to disk.
    document.Save("Ean13Barcode.pdf")

    Constructors

    PdfEan13Barcode()

    Initializes a new instance of the PdfEan13Barcode class.

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

    PdfEan13Barcode(String)

    Initializes a new instance of the PdfEan13Barcode class.

    Declaration
    public PdfEan13Barcode(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 PdfEan13Barcode.
    PdfEan13Barcode barcode = new PdfEan13Barcode("4006381333931");
    //Set the font to Ean13.
    barcode.Font = font;
    //Draw a barcode in the new Page.
    barcode.Draw(page, new PointF(25, 100));
    //Save the  document to disk.
    document.Save("Ean13Barcode.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 PdfEan13Barcode.
    Dim barcode As PdfEan13Barcode = New PdfEan13Barcode("4006381333931")
    'Set the font to Ean13.
    barcode.Font = font
    'Draw a barcode in the new Page.
    barcode.Draw(page, new PointF(25, 100))
    'Save the  document to disk.
    document.Save("Ean13Barcode.pdf")

    Methods

    Draw(PdfPageBase)

    Draws the barcode on the PdfPage.

    Declaration
    public virtual void Draw(PdfPageBase page)
    Parameters
    Type Name Description
    PdfPageBase page

    The PDF page.

    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 PdfEan13Barcode.
    PdfEan13Barcode barcode = new PdfEan13Barcode();
    //Set the barcode text.
    barcode.Text = "4006381333931";
    barcode.Location = new PointF(100,100);
    //Draw a barcode in the new Page.
    barcode.Draw(page);
    //Save the  document to disk.
    document.Save("Ean13Barcode.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()
    'Creates a new PdfEan13Barcode.
    Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
    'Set the barcode text.
    barcode.Text = "4006381333931"
    barcode.Location = new PointF(100,100);
    'Draw a barcode in the new Page.
    barcode.Draw(page)
    'Save the  document to disk.
    document.Save("Ean13Barcode.pdf")

    Draw(PdfPageBase, PointF)

    Draws the barcode on the PdfPage at the specified location.

    Declaration
    public virtual void Draw(PdfPageBase page, PointF location)
    Parameters
    Type Name Description
    PdfPageBase page

    The pdf page.

    System.Drawing.PointF location

    The barcode location.

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

    Draw(PdfPageBase, PointF, SizeF)

    Draw PdfEan13Barcode based on location and size values.

    Declaration
    public void Draw(PdfPageBase page, PointF location, SizeF size)
    Parameters
    Type Name Description
    PdfPageBase page

    The PDF page.

    System.Drawing.PointF location

    The location of the barcode on the PDF page.

    System.Drawing.SizeF size

    The size of the barcode.

    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 PdfEan13Barcode.
    PdfEan13Barcode barcode = new PdfEan13Barcode();
    //Set the barcode text.
    barcode.Text = "4006381333931";
    //Draw a barcode in the new Page.
    barcode.Draw(page, new PointF(25, 500), new SizeF(200,200));
    //Save the  document to disk.
    document.Save("Ean13Barcode.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()
    'Creates a new PdfEan13Barcode.
    Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
    'Set the barcode text.
    barcode.Text = "4006381333931"
    'Draw a barcode in the new Page.
    barcode.Draw(page, New PointF(25, 500), New SizeF(200, 200))
    'Save the  document to disk.
    document.Save("Ean13Barcode.pdf")

    Draw(PdfPageBase, RectangleF)

    Draw PdfEan13Barcode based on rectangle input values.

    Declaration
    public void Draw(PdfPageBase page, RectangleF rectangle)
    Parameters
    Type Name Description
    PdfPageBase page

    The PDF page.

    System.Drawing.RectangleF rectangle

    The bounds of the barcode.

    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 PdfEan13Barcode.
    PdfEan13Barcode barcode = new PdfEan13Barcode();
    //Set the barcode text.
    barcode.Text = "4006381333931";
    //Draw a barcode in the new Page.
    barcode.Draw(page, new RectangleF(25, 100, 200, 200));
    //Save the  document to disk.
    document.Save("Ean13Barcode.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()
    'Creates a new PdfEan13Barcode.
    Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
    'Set the barcode text.
    barcode.Text = "4006381333931"
    'Draw a barcode in the new Page.
    barcode.Draw(page, New RectangleF(25, 100, 200, 200))
    'Save the  document to disk.
    document.Save("Ean13Barcode.pdf")

    Draw(PdfPageBase, Single, Single, Single, Single)

    Draw PdfEan13Barcode based on float input values.

    Declaration
    public void Draw(PdfPageBase page, float x, float y, float width, float height)
    Parameters
    Type Name Description
    PdfPageBase page

    The PDF page.

    System.Single x

    The x-coordinate of the upper-left corner of the bounding rectangle.

    System.Single y

    The y-coordinate of the upper-top corner of the bounding rectangle.

    System.Single width

    The width of the bounding rectangle.

    System.Single height

    The height of the bounding rectangle.

    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 PdfEan13Barcode.
    PdfEan13Barcode barcode = new PdfEan13Barcode();
    //Set the barcode text.
    barcode.Text = "4006381333931";
    //Draw a barcode in the new Page.
    barcode.Draw(page, 25, 100, 200, 200);
    //Save the  document to disk.
    document.Save("Ean13Barcode.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()
    'Creates a new PdfEan13Barcode.
    Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
    'Set the barcode text.
    barcode.Text = "4006381333931"
    'Draw a barcode in the new Page.
    barcode.Draw(page, 25, 100, 200, 200)
    'Save the  document to disk.
    document.Save("Ean13Barcode.pdf")

    ToImage()

    Exports the barcode as image. The barcode image.

    Declaration
    public virtual Image ToImage()
    Returns
    Type Description
    System.Drawing.Image
    Examples
    //Creates a new PdfEan13Barcode.
    PdfEan13Barcode barcode = new PdfEan13Barcode();
    //Set the barcode text.
    barcode.Text = "4006381333931";
    //Get the image for PdfEan13Barcode.
    Image image= barcode.ToImage();
    //Save the image into Disk
    image.Save("PdfEan13.png", ImageFormat.Png);
    'Creates a new PdfEan13Barcode.
    Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
    'Set the barcode text.
    barcode.Text = "4006381333931"
    'Get the image for PdfEan13Barcode.
    Dim image As Image = barcode.ToImage()
    'Save the image into Disk
    image.Save("PdfEan13.png", ImageFormat.Png)

    ToImage(SizeF)

    Declaration
    public Image ToImage(SizeF size)
    Parameters
    Type Name Description
    System.Drawing.SizeF size
    Returns
    Type Description
    System.Drawing.Image
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved