ASP.NET Core

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

    Show / Hide Table of Contents

    Class PdfBarcodeExtension

    Represents the extension for exporting Barcode as image.

    Inheritance
    System.Object
    PdfBarcodeExtension
    Namespace: Syncfusion.Pdf.Graphics
    Assembly: Syncfusion.Pdf.Imaging.Portable.dll
    Syntax
    public static class PdfBarcodeExtension : Object

    Methods

    ToImage(PdfBidimensionalBarcode)

    Exports the barcode as image.

    Declaration
    public static Image ToImage(this PdfBidimensionalBarcode barcode)
    Parameters
    Type Name Description
    PdfBidimensionalBarcode barcode
    Returns
    Type Description
    System.Drawing.Image

    The barcode image.

    Examples
    //Creates a new PDF data matrix barcode.
     PdfDataMatrixBarcode barcode = new PdfDataMatrixBarcode();
    //Set the barcode text.
     barcode.Text = "Test";            
    //Set the dimension of the barcode.
     barcode.XDimension = 5;
    //Export the barcode as image.
     Image img = barcode.ToImage();       
    //Save document to disk.
     img.Save("barcode.png", ImageFormat.Png);
    //Creates a new PDF data matrix barcode.
     Dim barcode As PdfDataMatrixBarcode = New PdfDataMatrixBarcode()
    //Set the barcode text.
     barcode.Text = "Test"          
    //Set the dimension of the barcode.
     barcode.XDimension = 5;
    //Export the barcode as image.
      Dim img As Image = barcode.ToImage()     
    //Save document to disk.
     img.Save("barcode.png", ImageFormat.Png)     

    ToImage(PdfBidimensionalBarcode, SizeF)

    Exports the barcode as image.

    Declaration
    public static Image ToImage(this PdfBidimensionalBarcode barcode, SizeF size)
    Parameters
    Type Name Description
    PdfBidimensionalBarcode barcode
    System.Drawing.SizeF size

    The size of the barcode.

    Returns
    Type Description
    System.Drawing.Image

    The barcode image

    Examples
    //Creates a new PDF data matrix barcode.
     PdfDataMatrixBarcode barcode = new PdfDataMatrixBarcode();
    //Set the barcode text.
     barcode.Text = "Test";            
    //Set the dimension of the barcode.
     barcode.XDimension = 5;
    //Export the barcode as image.
     Image img = barcode.ToImage(new SizeF(200,200));       
    //Save document to disk.
     img.Save("barcode.png", ImageFormat.Png);
    //Creates a new PDF data matrix barcode.
     Dim barcode As PdfDataMatrixBarcode = New PdfDataMatrixBarcode()
    //Set the barcode text.
     barcode.Text = "Test"          
    //Set the dimension of the barcode.
     barcode.XDimension = 5;
    //Export the barcode as image.
     Dim img As Image = barcode.ToImage(New SizeF(200, 200)) 
    //Save document to disk.
     img.Save("barcode.png", ImageFormat.Png)     

    ToImage(PdfUnidimensionalBarcode)

    Exports the barcode as image.

    Declaration
    public static Image ToImage(this PdfUnidimensionalBarcode barcode)
    Parameters
    Type Name Description
    PdfUnidimensionalBarcode barcode
    Returns
    Type Description
    System.Drawing.Image

    The barcode image.

    Examples
    //Creates a new PdfCode11Barcode.
    PdfCode11Barcode barcode = new PdfCode11Barcode();
    //Set the barcode text.
    barcode.Text = "00-74-23-90";
    //Exporting barcode as image
     Image img = barcode.ToImage();
    //Save the image into Disk
    img.Save("barcode.png", ImageFormat.Png);
    //Creates a new PdfCode11Barcode.
     Dim barcode As PdfCode11Barcode = New PdfCode11Barcode()
    //Set the barcode text.
     barcode.Text = "00-74-23-90"  
    //Exporting barcode as image
     Dim img As Image = barcode.ToImage() 
    //Save document to disk.
     img.Save("barcode.png", ImageFormat.Png)     

    ToImage(PdfUnidimensionalBarcode, SizeF)

    Export the barcode as image.

    Declaration
    public static Image ToImage(this PdfUnidimensionalBarcode barcode, SizeF size)
    Parameters
    Type Name Description
    PdfUnidimensionalBarcode barcode
    System.Drawing.SizeF size

    The size of the barcode.

    Returns
    Type Description
    System.Drawing.Image

    The barcode image

    Examples
    //Creates a new PdfCode11Barcode.
    PdfCode11Barcode barcode = new PdfCode11Barcode();
    //Set the barcode text.
    barcode.Text = "00-74-23-90";
    //Exporting barcode as image
     Image img = barcode.ToImage(new SizeF(200,200));
    //Save the image into Disk
    img.Save("barcode.png", ImageFormat.Png);
    //Creates a new PdfCode11Barcode.
     Dim barcode As PdfCode11Barcode = New PdfCode11Barcode()
    //Set the barcode text.
     barcode.Text = "00-74-23-90"  
    //Exporting barcode as image
     Dim img As Image = barcode.ToImage(New SizeF(200,200)) 
    //Save document to disk.
     img.Save("barcode.png", ImageFormat.Png)     

    See Also

    PdfBarcodeExtension
    Back to top Generated by DocFX
    Copyright © 2001 - 2022 Syncfusion Inc. All Rights Reserved