ASP.NET Core

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

    Show / Hide Table of Contents

    Class PdfBidimensionalBarcode

    Inheritance
    System.Object
    PdfBidimensionalBarcode
    Pdf417Barcode
    PdfDataMatrixBarcode
    PdfQRBarcode
    Namespace: Syncfusion.Pdf.Barcode
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public abstract class PdfBidimensionalBarcode : Object
    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 datamatrix barcode.
    PdfDataMatrixBarcode datamatrix = new PdfDataMatrixBarcode();
    //Sets the barcode text.
    datamatrix.Text = "Test";   
    //Set the dimention of the barcode.
    datamatrix.XDimension = 5;
    //Set the barcode location.
    datamatrix.Location = new PointF(100, 100);
    //Draws a barcode on the new Page.
    datamatrix.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 datamatrix barcode.
    Dim datamatrix As New PdfDataMatrixBarcode()
    'Sets the barcode text.
    datamatrix.Text = "Test"  
    'Set the dimention of the barcode.
    datamatrix.XDimension = 5
    'Set the barcode location.
    datamatrix.Location = New PointF(100, 100)
    'Draws a barcode on the new Page.
    datamatrix.Draw(page)
    'Save document to disk.
    document.Save("output.pdf")
    'Close the document.
    document.Close(True)

    Constructors

    PdfBidimensionalBarcode()

    Declaration
    public 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 = "www.syncfusion.com";
    //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 = "www.syncfusion.com"
    '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

    BackColor

    Declaration
    public PdfColor BackColor { get; set; }
    Property Value
    Type Description
    PdfColor
    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 datamatrix barcode.
    PdfDataMatrixBarcode datamatrix = new PdfDataMatrixBarcode();
    //Sets the barcode text.
    datamatrix.Text = "Test";
    //Set back color.
    datamatrix.BackColor = new PdfColor(Color.Red);
    //Set the dimention of the barcode.
    datamatrix.XDimension = 5;
    //Set the barcode location.
    datamatrix.Location = new PointF(100, 100);
    //Draws a barcode on the new Page.
    datamatrix.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 datamatrix barcode.
    Dim datamatrix As New PdfDataMatrixBarcode()
    'Sets the barcode text.
    datamatrix.Text = "Test"
    'Set back color.
    datamatrix.BackColor = New PdfColor(Color.Red)
    'Set the dimention of the barcode.
    datamatrix.XDimension = 5
    'Set the barcode location.
    datamatrix.Location = New PointF(100, 100)
    'Draws a barcode on the new Page.
    datamatrix.Draw(page)
    'Save document to disk.
    document.Save("output.pdf")
    'Close the document.
    document.Close(True)

    ForeColor

    Declaration
    public PdfColor ForeColor { get; set; }
    Property Value
    Type Description
    PdfColor
    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 datamatrix barcode.
    PdfDataMatrixBarcode datamatrix = new PdfDataMatrixBarcode();
    //Sets the barcode text.
    datamatrix.Text = "Test";
    //Set fore color.
    datamatrix.ForeColor = new PdfColor(Color.Red);
    //Set back color.
    datamatrix.BackColor = new PdfColor(Color.Yellow);
    //Set the dimention of the barcode.
    datamatrix.XDimension = 5;
    //Set the barcode location.
    datamatrix.Location = new PointF(100, 100);
    //Draws a barcode on the new Page.
    datamatrix.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 datamatrix barcode.
    Dim datamatrix As New PdfDataMatrixBarcode()
    'Sets the barcode text.
    datamatrix.Text = "Test"
    'Set fore color.
    datamatrix.ForeColor = New PdfColor(Color.Red)
    'Set back color.
    datamatrix.BackColor = New PdfColor(Color.Yellow)
    'Set the dimention of the barcode.
    datamatrix.XDimension = 5
    'Set the barcode location.
    datamatrix.Location = New PointF(100, 100)
    'Draws a barcode on the new Page.
    datamatrix.Draw(page)
    'Save document to disk.
    document.Save("output.pdf")
    'Close the document.
    document.Close(True)

    Location

    Gets or set the location of the barcode to be rendered in the page.

    Declaration
    public PointF Location { get; set; }
    Property Value
    Type Description
    Syncfusion.Drawing.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();
    //Creates a new PDF datamatrix barcode.
    PdfDataMatrixBarcode datamatrix = new PdfDataMatrixBarcode();
    //Sets the barcode text.
    datamatrix.Text = "Test";
    //Set back color.
    datamatrix.BackColor = new PdfColor(Color.Red);
    //Set the dimention of the barcode.
    datamatrix.XDimension = 5;
    //Set the barcode location.
    datamatrix.Location = new PointF(100, 100);
    //Draws a barcode on the new Page.
    datamatrix.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 datamatrix barcode.
    Dim datamatrix As New PdfDataMatrixBarcode()
    'Sets the barcode text.
    datamatrix.Text = "Test"
    'Set back color.
    datamatrix.BackColor = New PdfColor(Color.Red)
    'Set the dimention of the barcode.
    datamatrix.XDimension = 5
    'Set the barcode location.
    datamatrix.Location = New PointF(100, 100)
    'Draws a barcode on the new Page.
    datamatrix.Draw(page)
    'Save document to disk.
    document.Save("output.pdf")
    'Close the document.
    document.Close(True)

    QuietZone

    Gets or sets Quietzone for the barcode.

    Declaration
    public PdfBarcodeQuietZones QuietZone { get; set; }
    Property Value
    Type Description
    PdfBarcodeQuietZones

    Size

    Gets or set the size of the barcode.

    Declaration
    public SizeF Size { get; set; }
    Property Value
    Type Description
    Syncfusion.Drawing.SizeF
    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)

    Text

    Declaration
    public string Text { get; set; }
    Property Value
    Type Description
    System.String
    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 datamatrix barcode.
    PdfDataMatrixBarcode datamatrix = new PdfDataMatrixBarcode();
    //Sets the barcode text.
    datamatrix.Text = "Test";
    //Set back color.
    datamatrix.BackColor = new PdfColor(Color.Red);
    //Set the dimention of the barcode.
    datamatrix.XDimension = 5;
    //Set the barcode location.
    datamatrix.Location = new PointF(100, 100);
    //Draws a barcode on the new Page.
    datamatrix.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 datamatrix barcode.
    Dim datamatrix As New PdfDataMatrixBarcode()
    'Sets the barcode text.
    datamatrix.Text = "Test"
    'Set back color.
    datamatrix.BackColor = New PdfColor(Color.Red)
    'Set the dimention of the barcode.
    datamatrix.XDimension = 5
    'Set the barcode location.
    datamatrix.Location = New PointF(100, 100)
    'Draws a barcode on the new Page.
    datamatrix.Draw(page)
    'Save document to disk.
    document.Save("output.pdf")
    'Close the document.
    document.Close(True)

    XDimension

    Declaration
    public float XDimension { get; set; }
    Property Value
    Type Description
    System.Single
    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 datamatrix barcode.
    PdfDataMatrixBarcode datamatrix = new PdfDataMatrixBarcode();
    //Sets the barcode text.
    datamatrix.Text = "Test";
    //Set back color.
    datamatrix.BackColor = new PdfColor(Color.Red);
    //Set the dimention of the barcode.
    datamatrix.XDimension = 5;
    //Set the barcode location.
    datamatrix.Location = new PointF(100, 100);
    //Draws a barcode on the new Page.
    datamatrix.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 datamatrix barcode.
    Dim datamatrix As New PdfDataMatrixBarcode()
    'Sets the barcode text.
    datamatrix.Text = "Test"
    'Set back color.
    datamatrix.BackColor = New PdfColor(Color.Red)
    'Set the dimention of the barcode.
    datamatrix.XDimension = 5
    'Set the barcode location.
    datamatrix.Location = New PointF(100, 100)
    'Draws a barcode on the new Page.
    datamatrix.Draw(page)
    'Save document to disk.
    document.Save("output.pdf")
    'Close the document.
    document.Close(True)

    Methods

    Draw(PdfPageBase)

    Draw the barcode to PDF page.

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

    The PDF page to be drawn 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();
    //Creates a new PDF datamatrix barcode.
    PdfDataMatrixBarcode datamatrix = new PdfDataMatrixBarcode();
    //Sets the barcode text.
    datamatrix.Text = "Test";
    //Set back color.
    datamatrix.BackColor = new PdfColor(Color.Red);
    //Set the dimention of the barcode.
    datamatrix.XDimension = 5;
    //Set the barcode location.
    datamatrix.Location = new PointF(100, 100);
    //Draws a barcode on the new Page.
    datamatrix.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 datamatrix barcode.
    Dim datamatrix As New PdfDataMatrixBarcode()
    'Sets the barcode text.
    datamatrix.Text = "Test"
    'Set back color.
    datamatrix.BackColor = New PdfColor(Color.Red)
    'Set the dimention of the barcode.
    datamatrix.XDimension = 5
    'Set the barcode location.
    datamatrix.Location = New PointF(100, 100)
    'Draws a barcode on the new Page.
    datamatrix.Draw(page)
    'Save document to disk.
    document.Save("output.pdf")
    'Close the document.
    document.Close(True)

    Draw(PdfPageBase, PointF)

    Draw the barcode to PDF.

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

    The PdfPageBase to be drawn the barcode.

    Syncfusion.Drawing.PointF location

    The location of the barcode to be drawn in the 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();
    //Creates a new PDF datamatrix barcode.
    PdfDataMatrixBarcode datamatrix = new PdfDataMatrixBarcode();
    //Sets the barcode text.
    datamatrix.Text = "Test";
    //Set back color.
    datamatrix.BackColor = new PdfColor(Color.Red);
    //Set the dimention of the barcode.
    datamatrix.XDimension = 5;        
    //Draws a barcode on the new Page.
    datamatrix.Draw(page, new PointF(100,100));
    //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 datamatrix barcode.
    Dim datamatrix As New PdfDataMatrixBarcode()
    'Sets the barcode text.
    datamatrix.Text = "Test"
    'Set back color.
    datamatrix.BackColor = New PdfColor(Color.Red)
    'Set the dimention of the barcode.
    datamatrix.XDimension = 5       
    'Draws a barcode on the new Page.
    datamatrix.Draw(page, New PointF(100,100))
    'Save document to disk.
    document.Save("output.pdf")
    'Close the document.
    document.Close(True)

    Extension Methods

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