menu

Xamarin.Forms

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

    Show / Hide Table of Contents

    Class PdfQRBarcode

    Represents the PDF QR barcode.

    Inheritance
    System.Object
    PdfBidimensionalBarcode
    PdfQRBarcode
    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 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
    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
    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)

    Logo

    Gets or sets the logo image that will be displayed in the center of the QR barcode.

    Declaration
    public QRCodeLogo Logo { set; }
    Property Value
    Type
    QRCodeLogo
    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 logo image to QR barcode. 
    FileStream imageStream = new FileStream("logo.png", FileMode.Open, FileAccess.Read);
    //Create QR Barcode logo.
    QRCodeLogo qRCodeLogo = new QRCodeLogo(imageStream);
    //Set the QR barcode logo.
    qrBarcode.Logo = qRCodeLogo;
    //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);

    Size

    Gets or set the size of the barcode.

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

    Version

    Declaration
    public QRCodeVersion Version { get; set; }
    Property Value
    Type
    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(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 PdfQRBarcode.
    PdfQRBarcode qrCode = new PdfQRBarcode();
    //Set the barcode text.
    qrCode.Text = "012345678";
    qrCode.Location = new PointF(100,100);
    //Draw a barcode in the new pdfGraphics.
    qrCode.Draw(graphics);
    //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()
    'Create Pdf graphics for the page.
    Dim graphics As PdfGraphics =page.Graphics
    '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 pdfGraphics.
    qrCode.Draw(graphics)
    'Save the  document to disk.
    document.Save("QRBarcode.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 PdfQRBarcode.
    PdfQRBarcode qrCode = new PdfQRBarcode();
    //Set the barcode text.
    qrCode.Text = "012345678";
    //Draw a barcode in the new PdfGraphics.
    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()
    'Create Pdf graphics for the page.
    Dim graphics As PdfGraphics=page.Graphics
    'Creates a new PdfQRBarcode.
    Dim qrCode As PdfQRBarcode = New PdfQRBarcode()
    'Set the barcode text.
    qrCode.Text = "012345678"
    'Draw a barcode in the new pdfGraphics.
    qrCode.Draw(graphics, New PointF(25, 500))
    'Save the  document to disk.
    document.Save("QRBarcode.pdf")

    Draw(PdfGraphics, PointF, SizeF)

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

    Draw(PdfGraphics, RectangleF)

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

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

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

    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.

    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 Pdf graphics for the page
    PfgGraphics graphics=page.Graphics;
    //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(graphics, 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()
    //Create Pdf graphics for the page
    Dim graphics As PdfGraphics=page.Graphics
    '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(graphics, 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
    PointF location
    SizeF size

    Draw(PdfPageBase, RectangleF)

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

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

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

    Extension Methods

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