menu

Xamarin.Forms

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

    Show / Hide Table of Contents

    Class Pdf417Barcode

    Represents the Pdf417 barcode.

    Inheritance
    System.Object
    PdfBidimensionalBarcode
    Pdf417Barcode
    Inherited Members
    PdfBidimensionalBarcode.BackColor
    PdfBidimensionalBarcode.ForeColor
    PdfBidimensionalBarcode.Location
    PdfBidimensionalBarcode.QuietZone
    PdfBidimensionalBarcode.Text
    PdfBidimensionalBarcode.XDimension
    Namespace: Syncfusion.Pdf.Barcode
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public class Pdf417Barcode : PdfBidimensionalBarcode
    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 Pdf417Barcode.
    Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
    //Set the barcode text.
    pdf417Barcode.Text = "012345678";
    pdf417Barcode.Location = new PointF(100,100);
    //Draw a barcode in the new Page.
    pdf417Barcode.Draw(page);
    //Save the  document to disk.
    document.Save("417Barcode.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 Pdf417Barcode.
    Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
    'Set the barcode text.
    pdf417Barcode.Text = "012345678"
    pdf417Barcode.Location = new PointF(100,100);
    'Draw a barcode in the new Page.
    pdf417Barcode.Draw(page)
    'Save the  document to disk.
    document.Save("417Barcode.pdf")

    Constructors

    Pdf417Barcode()

    Declaration
    public Pdf417Barcode()

    Properties

    ErrorCorrectionLevel

    Gets or sets the error correction level.

    Declaration
    public Pdf417ErrorCorrectionLevel ErrorCorrectionLevel { get; set; }
    Property Value
    Type
    Pdf417ErrorCorrectionLevel
    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();
    //Creates a new Pdf417Barcode.
    Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
    //Set text.
    pdf417Barcode.Text = "012345678";
    //Set barcode size.
    pdf417Barcode.Size = new SizeF(200, 200);
    //Set the error correction level.
    pdf417Barcode.ErrorCorrectionLevel = Pdf417ErrorCorrectionLevel.Auto;
    //Set the dimention of the barcode.
    pdf417Barcode.XDimension = 3;
    //Set the barcode location.
    pdf417Barcode.Location = new PointF(100, 100);
    //Draw the barcode to PDF page.
    pdf417Barcode.Draw(page);
    //Save document to disk.
    document.Save("output.pdf");
    //Close the document.
    document.Close(true);
    'Create a new PDF document.
    Dim document As 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 Pdf417Barcode.
    Dim pdf417Barcode As New Pdf417Barcode()
    'Set text.
    pdf417Barcode.Text = "012345678"
    'Set barcode size.
    pdf417Barcode.Size = New SizeF(200, 200)
    'Set the error correction level.
    pdf417Barcode.ErrorCorrectionLevel = PdfErrorCorrectionLevel.High
    'Set the dimention of the barcode.
    pdf417Barcode.XDimension = 5
    'Set the barcode location.
    pdf417Barcode.Location = New PointF(100, 100)
    'Draw the barcode to PDF page.
    pdf417Barcode.Draw(page)
    'Save document to disk.
    document.Save("output.pdf")
    'Close the document.
    document.Close(True)

    Size

    Gets or set the size of the barcode.

    Declaration
    public override SizeF Size { get; set; }
    Property Value
    Type
    SizeF
    Overrides
    PdfBidimensionalBarcode.Size

    Methods

    Draw(PdfGraphics)

    Draws the barcode on the PdfGraphics.

    Declaration
    public override void Draw(PdfGraphics graphics)
    Parameters
    Type Name Description
    PdfGraphics graphics

    The PDF graphics.

    Overrides
    PdfBidimensionalBarcode.Draw(PdfGraphics)
    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 Pdf graphics for the page.
     PdfGraphics graphics=page.Graphics;
    //Create font and font style.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
    //Creates a new Pdf417Barcode.
    Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
    //Set the barcode text.
    pdf417Barcode.Text = "012345678";
    pdf417Barcode.Location = new PointF(100,100);
    //Draw a barcode in the new PdfGraphics.
    pdf417Barcode.Draw(graphics);
    //Save the  document to disk.
    document.Save("417Barcode.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 Pdf graphics for the page.
     Dim graphics As PdfGraphics=page.Graphics
    'Creates a new Pdf417Barcode.
    Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
    'Set the barcode text.
    pdf417Barcode.Text = "012345678"
    pdf417Barcode.Location = new PointF(100,100);
    'Draw a barcode in the new PdfGraphics.
    pdf417Barcode.Draw(graphics)
    'Save the  document to disk.
    document.Save("417Barcode.pdf")

    Draw(PdfGraphics, PointF)

    Draws the barcode on the PdfGraphics at the specified location.

    Declaration
    public override void Draw(PdfGraphics graphics, PointF location)
    Parameters
    Type Name Description
    PdfGraphics graphics

    The pdf graphics.

    PointF location

    The barcode location.

    Overrides
    PdfBidimensionalBarcode.Draw(PdfGraphics, PointF)
    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 Pdf graphics for the page.
     PdfGraphics graphics=page.Graphics;
    //Create font and font style.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
    //Creates a new Pdf417Barcode.
    Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
    //Set the barcode text.
    pdf417Barcode.Text = "012345678";
    //Draw a barcode in the new PdfGraphics.
    pdf417Barcode.Draw(graphics, new PointF(25, 500));
    //Save the  document to disk.
    document.Save("417Barcode.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 Pdf graphics for the page.
     Dim graphics As PdfGraphics =page.Graphics
    'Creates a new Pdf417Barcode.
    Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
    'Set the barcode text.
    pdf417Barcode.Text = "012345678"
    'Draw a barcode in the new PdfGraphics.
    pdf417Barcode.Draw(graphics, New PointF(25, 500))
    'Save the  document to disk.
    document.Save("417Barcode.pdf")

    Draw(PdfGraphics, PointF, SizeF)

    Draws the barcode on the PdfGraphics at the specified location.

    Declaration
    public void Draw(PdfGraphics graphics, PointF location, SizeF size)
    Parameters
    Type Name Description
    PdfGraphics graphics

    The PDF graphics.

    PointF location

    The location of the barcode on the PDF page.

    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 Pdf graphics for the page.
     PdfGraphics graphics=page.Graphics;
    //Create font and font style.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
    //Creates a new Pdf417Barcode.
    Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
    //Set the barcode text.
    pdf417Barcode.Text = "012345678";
    //Draw a barcode in the new PdfGraphics.
    pdf417Barcode.Draw(graphics, new PointF(25, 500), new SizeF(200,200));
    //Save the  document to disk.
    document.Save("417Barcode.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 Pdf graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics
    'Creates a new Pdf417Barcode.
    Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
    'Set the barcode text.
    pdf417Barcode.Text = "012345678"
    'Draw a barcode in the new PdfGraphics.
    pdf417Barcode.Draw(graphics, New PointF(25, 500), New SizeF(200, 200))
    'Save the  document to disk.
    document.Save("417Barcode.pdf")

    Draw(PdfGraphics, RectangleF)

    Draws the barcode on the PdfGraphics at the specified rectangle.

    Declaration
    public void Draw(PdfGraphics graphics, RectangleF rectangle)
    Parameters
    Type Name Description
    PdfGraphics graphics

    The PDF graphics.

    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 Pdf graphics for the page.
     PdfGraphics graphics=page.Graphics;
    //Create font and font style.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
    //Creates a new Pdf417Barcode.
    Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
    //Set the barcode text.
    pdf417Barcode.Text = "012345678";
    //Draw a barcode in the new PdfGraphics.
    pdf417Barcode.Draw(graphics, new RectangleF(25, 100, 200, 200));
    //Save the  document to disk.
    document.Save("417Barcode.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 Pdf graphics for the page.
    Dim graphics As PdfGraphics=page.Graphics
    'Creates a new Pdf417Barcode.
    Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
    'Set the barcode text.
    pdf417Barcode.Text = "012345678"
    'Draw a barcode in the new PdfGraphics.
    pdf417Barcode.Draw(graphics, New RectangleF(25, 100, 200, 200))
    'Save the  document to disk.
    document.Save("417Barcode.pdf")

    Draw(PdfGraphics, Single, Single, Single, Single)

    Draws the barcode based on the provided float values.

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

    The PDF graphics.

    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 Pdf graphics for the page.
     PdfGraphics graphics=page.Graphics;
    //Create font and font style.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
    //Creates a new Pdf417Barcode.
    Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
    //Set the barcode text.
    pdf417Barcode.Text = "012345678";
    //Draw a barcode in the new PdfGraphics.
    pdf417Barcode.Draw(graphics, 25, 100, 200, 200);
    //Save the  document to disk.
    document.Save("417Barcode.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 Pdf graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics
    'Creates a new Pdf417Barcode.
    Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
    'Set the barcode text.
    pdf417Barcode.Text = "012345678"
    'Draw a barcode in the new PdfGraphics.
    pdf417Barcode.Draw(graphics, 25, 100, 200, 200)
    'Save the  document to disk.
    document.Save("417Barcode.pdf")

    Draw(PdfPageBase)

    Draws the barcode on the PdfPage.

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

    The PDF page.

    Overrides
    PdfBidimensionalBarcode.Draw(PdfPageBase)
    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 Pdf graphics for the page
    PdfGraphics graphics=page.Graphics;
    //Create font and font style.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
    //Creates a new Pdf417Barcode.
    Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
    //Set the barcode text.
    pdf417Barcode.Text = "012345678";
    pdf417Barcode.Location = new PointF(100,100);
    //Draw a barcode in the new Page.
    pdf417Barcode.Draw(page);
    //Save the  document to disk.
    document.Save("417Barcode.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 Pdf graphics for the page
    Dim graphics As PdfGraphics=page.Graphics
    'Creates a new Pdf417Barcode.
    Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
    'Set the barcode text.
    pdf417Barcode.Text = "012345678"
    pdf417Barcode.Location = new PointF(100,100);
    'Draw a barcode in the new Page.
    pdf417Barcode.Draw(page)
    'Save the  document to disk.
    document.Save("417Barcode.pdf")

    Draw(PdfPageBase, PointF)

    Draws the barcode on the PdfPage at the specified location.

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

    The pdf page.

    PointF location

    The barcode location.

    Overrides
    PdfBidimensionalBarcode.Draw(PdfPageBase, PointF)
    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 Pdf417Barcode.
    Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
    //Set the barcode text.
    pdf417Barcode.Text = "012345678";
    //Draw a barcode in the new Page.
    pdf417Barcode.Draw(page, new PointF(25, 500));
    //Save the  document to disk.
    document.Save("417Barcode.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 Pdf417Barcode.
    Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
    'Set the barcode text.
    pdf417Barcode.Text = "012345678"
    'Draw a barcode in the new Page.
    pdf417Barcode.Draw(page, New PointF(25, 500))
    'Save the  document to disk.
    document.Save("417Barcode.pdf")

    Draw(PdfPageBase, PointF, SizeF)

    Draw Pdf417Barcode 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.

    PointF location

    The location of the barcode on the PDF page.

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

    Draw(PdfPageBase, RectangleF)

    Draw Pdf417Barcode based on rectangle input values.

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

    The PDF page.

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

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

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

    Extension Methods

    PdfBarcodeExtension.ToImage(PdfBidimensionalBarcode)
    PdfBarcodeExtension.ToImage(PdfBidimensionalBarcode, SizeF)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved