ASP.NET MVC

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class Pdf417Barcode - ASP.NETMVC API Reference | Syncfusion

    Show / Hide Table of Contents

    Class Pdf417Barcode

    Represents the Pdf417 barcode.

    Inheritance
    System.Object
    PdfBidimensionalBarcode
    Pdf417Barcode
    Inherited Members
    PdfBidimensionalBarcode.Size
    PdfBidimensionalBarcode.Text
    PdfBidimensionalBarcode.BackColor
    PdfBidimensionalBarcode.QuietZone
    PdfBidimensionalBarcode.XDimension
    PdfBidimensionalBarcode.Location
    PdfBidimensionalBarcode.ForeColor
    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 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 Description
    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)

    Methods

    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 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")

    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.

    System.Drawing.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.

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

    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 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")

    ToImage()

    Exports the barcode as image. The barcode image.

    Declaration
    public override Image ToImage()
    Returns
    Type Description
    System.Drawing.Image
    Overrides
    PdfBidimensionalBarcode.ToImage()
    Examples
    //Creates a new Pdf417Barcode.
    Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
    //Set the barcode text.
    pdf417Barcode.Text = "012345678";
    //Get the image for Pdf417Barcode.
    Image image= pdf417Barcode.ToImage();
    //Save the image into Disk
    image.Save("Pdf417.png", ImageFormat.Png);
    'Creates a new Pdf417Barcode.
    Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
    'Set the barcode text.
    pdf417Barcode.Text = "012345678"
    'Get the image for Pdf417Barcode.
    Dim image As Image = pdf417Barcode.ToImage()
    'Save the image into Disk
    image.Save("Pdf417.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