ASP.NET MVC

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

    Show / Hide Table of Contents

    Class PdfQRBarcode

    Represents the PDF QR barcode.

    Inheritance
    System.Object
    PdfBidimensionalBarcode
    PdfQRBarcode
    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 PdfQRBarcode : 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();
    //Creates a new PDF QR barcode.
    PdfQRBarcode qrBarcode = new PdfQRBarcode();
    //Set text.
    qrBarcode.Text = "012345678";
    //Set barcode size.
    qrBarcode.Size = new SizeF(200, 200);
    //Set the dimention of the barcode.
    qrBarcode.XDimension = 5;
    //Set the barcode location.
    qrBarcode.Location = new PointF(100, 100);
    //Draw the barcode to PDF page.
    qrBarcode.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 PDF QR barcode.
    Dim qrBarcode As New PdfQRBarcode()
    'Set text.
    qrBarcode.Text = "012345678"
    'Set barcode size.
    qrBarcode.Size = New SizeF(200, 200)
    'Set the dimention of the barcode.
    qrBarcode.XDimension = 5
    'Set the barcode location.
    qrBarcode.Location = New PointF(100, 100)
    'Draw the barcode to PDF page.
    qrBarcode.Draw(page)
    'Save document to disk.
    document.Save("output.pdf")
    'Close the document.
    document.Close(True)

    Constructors

    PdfQRBarcode()

    Initialize a new instance of the PdfQRBarcode class.

    Declaration
    public PdfQRBarcode()
    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 PDF QR barcode.
    PdfQRBarcode qrBarcode = new PdfQRBarcode();
    //Set text.
    qrBarcode.Text = "012345678";
    //Set barcode size.
    qrBarcode.Size = new SizeF(200, 200);
    //Set the dimention of the barcode.
    qrBarcode.XDimension = 5;
    //Set the barcode location.
    qrBarcode.Location = new PointF(100, 100);
    //Draw the barcode to PDF page.
    qrBarcode.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 PDF QR barcode.
    Dim qrBarcode As New PdfQRBarcode()
    'Set text.
    qrBarcode.Text = "012345678"
    'Set barcode size.
    qrBarcode.Size = New SizeF(200, 200)
    'Set the dimention of the barcode.
    qrBarcode.XDimension = 5
    'Set the barcode location.
    qrBarcode.Location = New PointF(100, 100)
    'Draw the barcode to PDF page.
    qrBarcode.Draw(page)
    'Save document to disk.
    document.Save("output.pdf")
    'Close the document.
    document.Close(True)

    Properties

    ErrorCorrectionLevel

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

    InputMode

    Declaration
    public InputMode InputMode { get; set; }
    Property Value
    Type Description
    InputMode
    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 PDF QR barcode.
    PdfQRBarcode qrBarcode = new PdfQRBarcode();
    //Set text.
    qrBarcode.Text = "012345678";
    //Set barcode size.
    qrBarcode.Size = new SizeF(200, 200);
    //Set the input mode.
    qrBarcode.InputMode = InputMode.BinaryMode;
    //Set the dimention of the barcode.
    qrBarcode.XDimension = 5;
    //Set the barcode location.
    qrBarcode.Location = new PointF(100, 100);
    //Draw the barcode to PDF page.
    qrBarcode.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 PDF QR barcode.
    Dim qrBarcode As New PdfQRBarcode()
    'Set text.
    qrBarcode.Text = "012345678"
    'Set barcode size.
    qrBarcode.Size = New SizeF(200, 200)
    'Set the input mode.
    qrBarcode.InputMode = InputMode.BinaryMode
    'Set the dimention of the barcode.
    qrBarcode.XDimension = 5
    'Set the barcode location.
    qrBarcode.Location = New PointF(100, 100)
    'Draw the barcode to PDF page.
    qrBarcode.Draw(page)
    'Save document to disk.
    document.Save("output.pdf")
    'Close the document.
    document.Close(True)

    Version

    Declaration
    public QRCodeVersion Version { get; set; }
    Property Value
    Type Description
    QRCodeVersion
    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 PDF QR barcode.
    PdfQRBarcode qrBarcode = new PdfQRBarcode();
    //Set text.
    qrBarcode.Text = "012345678";
    //Set barcode size.
    qrBarcode.Size = new SizeF(200, 200);
    //Set the QR barcode version.
    qrBarcode.Version = QRCodeVersion.Version05;
    //Set the dimention of the barcode.
    qrBarcode.XDimension = 5;
    //Set the barcode location.
    qrBarcode.Location = new PointF(100, 100);
    //Draw the barcode to PDF page.
    qrBarcode.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 PDF QR barcode.
    Dim qrBarcode As New PdfQRBarcode()
    'Set text.
    qrBarcode.Text = "012345678"
    'Set barcode size.
    qrBarcode.Size = New SizeF(200, 200)
    'Set the QR barcode version.
    qrBarcode.Version = QRCodeVersion.Version05
    'Set the dimention of the barcode.
    qrBarcode.XDimension = 5
    'Set the barcode location.
    qrBarcode.Location = New PointF(100, 100)
    'Draw the barcode to PDF page.
    qrBarcode.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 at the specified location.

    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 PdfQRBarcode.
    PdfQRBarcode qrCode = new PdfQRBarcode();
    //Set the barcode text.
    qrCode.Text = "012345678";
    qrCode.Location = new PointF(100,100);
    //Draw a barcode in the new Page.
    qrCode.Draw(page);
    //Save the  document to disk.
    document.Save("QRBarcode.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 PdfQRBarcode.
    Dim qrCode As PdfQRBarcode = New PdfQRBarcode()
    'Set the barcode text.
    qrCode.Text = "012345678"
    qrCode.Location = new PointF(100,100);
    'Draw a barcode in the new Page.
    qrCode.Draw(page)
    'Save the  document to disk.
    document.Save("QRBarcode.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 PdfQRBarcode.
    PdfQRBarcode qrCode = new PdfQRBarcode();
    //Set the barcode text.
    qrCode.Text = "012345678";
    //Draw a barcode in the new Page.
    qrCode.Draw(page, new PointF(25, 500));
    //Save the  document to disk.
    document.Save("QRBarcode.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 PdfQRBarcode.
    Dim qrCode As PdfQRBarcode = New PdfQRBarcode()
    'Set the barcode text.
    qrCode.Text = "012345678"
    'Draw a barcode in the new Page.
    qrCode.Draw(page, New PointF(25, 500))
    'Save the  document to disk.
    document.Save("QRBarcode.pdf")

    Draw(PdfPageBase, PointF, SizeF)

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

    Draw(PdfPageBase, RectangleF)

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

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

    Declaration
    public void Draw(PdfPageBase page, float a, float b, float width, float height)
    Parameters
    Type Name Description
    PdfPageBase page
    System.Single a
    System.Single b
    System.Single width
    System.Single height

    ToImage()

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