Search Results for

    Show / Hide Table of Contents

    Class GeneratedBarcode

    A barcode generated by IronBarCode.

    In addition to exporting the barcode as a graphic, we may also resize it, recolor it and annotate it with this class using fluent notation.

    GeneratedBarcodes may be exported as Images, Objects or PDF files. They may also be exported as HTML for use on the web.

    Inheritance
    System.Object
    GeneratedBarcode
    Namespace: IronBarCode
    Assembly: IronBarCode.dll
    Syntax
    public class GeneratedBarcode : Object

    Properties

    BarcodeType

    Gets the BarcodeEncoding type of this barcode.

    Declaration
    public BarcodeEncoding BarcodeType { get; }
    Property Value
    Type Description
    BarcodeEncoding

    The type of the barcode.

    BinaryStream

    Returns a System.IO.Stream of the barcode rendered as a Bitmap image.

    Declaration
    public Stream BinaryStream { get; }
    Property Value
    Type Description
    System.IO.Stream

    The barcode image as a binary stream.

    BinaryValue

    Gets the value of the barcode as binary data

    Declaration
    public byte[] BinaryValue { get; }
    Property Value
    Type Description
    System.Byte[]

    The barcode value as a byte array.

    Height

    Gets the final height of the generated barcode image in pixels.

    Includes the height of margins and annotations

    Declaration
    public int Height { get; }
    Property Value
    Type Description
    System.Int32

    The height in px

    Image

    Returns the barcode as an IronSoftware.Drawing.AnyBitmap

    Declaration
    public AnyBitmap Image { get; }
    Property Value
    Type Description
    IronSoftware.Drawing.AnyBitmap

    A IronSoftware.Drawing.AnyBitmap

    Value

    Gets the text value if the barcode

    Declaration
    public string Value { get; }
    Property Value
    Type Description
    System.String

    The barcode value.

    Width

    Gets the final width of the generated barcode image in pixels.

    Includes the width of margins and annotations

    Declaration
    public int Width { get; }
    Property Value
    Type Description
    System.Int32

    The width in px

    Methods

    AddAnnotationTextAboveBarcode(String)

    Annotates the barcode with any string of text.

    the text is rendered above the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddAnnotationTextAboveBarcode(string annotationText)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddAnnotationTextAboveBarcode(String, Font, Color)

    Annotates the barcode with any string of text.

    the text is rendered above the barcode.

    Declaration
    public GeneratedBarcode AddAnnotationTextAboveBarcode(string annotationText, Font fontFace, Color fontColor)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    IronSoftware.Drawing.Font fontFace

    The typeface of the annotation text.

    IronSoftware.Drawing.Color fontColor

    Color of the annotation text.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddAnnotationTextAboveBarcode(String, Font, Color, Int32)

    Annotates the barcode with any string of text.

    the text is rendered above the barcode.

    Declaration
    public GeneratedBarcode AddAnnotationTextAboveBarcode(string annotationText, Font fontFace, Color fontColor, int textSpacing)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    IronSoftware.Drawing.Font fontFace

    The typeface of the annotation text.

    IronSoftware.Drawing.Color fontColor

    Color of the annotation text.

    System.Int32 textSpacing

    The top and bottom spacing of the annotation text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddAnnotationTextAboveBarcode(String, Font, Color, String, Int32)

    Annotates the barcode with any string of text.

    the text is rendered above the barcode.

    Declaration
    public GeneratedBarcode AddAnnotationTextAboveBarcode(string annotationText, Font fontFace, Color fontColor, string fontPath, int textSpacing)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    IronSoftware.Drawing.Font fontFace

    The typeface of the annotation text.

    IronSoftware.Drawing.Color fontColor

    Color of the annotation text.

    System.String fontPath

    Path to the Font of the annotation text. This may be a relative or a full absolute path.

    System.Int32 textSpacing

    The top and bottom spacing of the annotation text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddAnnotationTextAboveBarcode(String, Font, Color, String, Int32, Int32)

    Annotates the barcode with any string of text.

    the text is rendered above the barcode.

    Declaration
    public GeneratedBarcode AddAnnotationTextAboveBarcode(string annotationText, Font fontFace, Color fontColor, string fontPath, int topTextSpacing = 0, int bottomTextSpacing = 0)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    IronSoftware.Drawing.Font fontFace

    The typeface of the annotation text.

    IronSoftware.Drawing.Color fontColor

    Color of the annotation text.

    System.String fontPath

    Path to the Font of the annotation text. This may be a relative or a full absolute path.

    System.Int32 topTextSpacing

    The top margin of the annotation text in pixels.

    System.Int32 bottomTextSpacing

    The bottom of the annotation text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddAnnotationTextAboveBarcode(String, Int32)

    Annotates the barcode with any string of text.

    the text is rendered above the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddAnnotationTextAboveBarcode(string annotationText, int textSpacing)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    System.Int32 textSpacing

    The top and bottom spacing of the annotation text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddAnnotationTextAboveBarcode(String, Int32, Int32)

    Annotates the barcode with any string of text.

    the text is rendered above the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddAnnotationTextAboveBarcode(string annotationText, int topTextSpacing, int bottomTextSpacing)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    System.Int32 topTextSpacing

    The top margin of the annotation text in pixels.

    System.Int32 bottomTextSpacing

    The bottom of the annotation text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddAnnotationTextAboveBarcode(String, String, Int32)

    Annotates the barcode with any string of text.

    the text is rendered above the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddAnnotationTextAboveBarcode(string annotationText, string fontPath, int textSpacing)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    System.String fontPath

    Path to the Font of the annotation text. This may be a relative or a full absolute path.

    System.Int32 textSpacing

    The top and bottom spacing of the annotation text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddAnnotationTextAboveBarcode(String, String, Int32, Int32)

    Annotates the barcode with any string of text.

    the text is rendered above the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddAnnotationTextAboveBarcode(string annotationText, string fontPath, int topTextSpacing = 0, int bottomTextSpacing = 0)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    System.String fontPath

    Path to the Font of the annotation text. This may be a relative or a full absolute path.

    System.Int32 topTextSpacing

    The top margin of the annotation text in pixels.

    System.Int32 bottomTextSpacing

    The bottom of the annotation text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddAnnotationTextBelowBarcode(String)

    Annotates the barcode with any string of text.

    the text is rendered below the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddAnnotationTextBelowBarcode(string annotationText)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddAnnotationTextBelowBarcode(String, Font, Color)

    Annotates the barcode with any string of text.

    the text is rendered below the barcode.

    Declaration
    public GeneratedBarcode AddAnnotationTextBelowBarcode(string annotationText, Font fontFace, Color fontColor)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    IronSoftware.Drawing.Font fontFace

    The typeface of the annotation text.

    IronSoftware.Drawing.Color fontColor

    Color of the annotation text.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddAnnotationTextBelowBarcode(String, Font, Color, Int32)

    Annotates the barcode with any string of text.

    the text is rendered below the barcode.

    Declaration
    public GeneratedBarcode AddAnnotationTextBelowBarcode(string annotationText, Font fontFace, Color fontColor, int textSpacing)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    IronSoftware.Drawing.Font fontFace

    The typeface of the annotation text.

    IronSoftware.Drawing.Color fontColor

    Color of the annotation text.

    System.Int32 textSpacing

    The top and bottom spacing of the annotation text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddAnnotationTextBelowBarcode(String, Font, Color, String, Int32)

    Annotates the barcode with any string of text.

    the text is rendered below the barcode.

    Declaration
    public GeneratedBarcode AddAnnotationTextBelowBarcode(string annotationText, Font fontFace, Color fontColor, string fontPath, int textSpacing = 0)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    IronSoftware.Drawing.Font fontFace

    The typeface of the annotation text.

    IronSoftware.Drawing.Color fontColor

    Color of the annotation text.

    System.String fontPath

    Path to the Font of the annotation text. This may be a relative or a full absolute path.

    System.Int32 textSpacing

    The top and bottom spacing of the annotation text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddAnnotationTextBelowBarcode(String, Font, Color, String, Int32, Int32)

    Annotates the barcode with any string of text.

    the text is rendered below the barcode.

    Declaration
    public GeneratedBarcode AddAnnotationTextBelowBarcode(string annotationText, Font fontFace, Color fontColor, string fontPath, int topTextSpacing, int bottomTextSpacing)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    IronSoftware.Drawing.Font fontFace

    The typeface of the annotation text.

    IronSoftware.Drawing.Color fontColor

    Color of the annotation text.

    System.String fontPath

    Path to the Font of the annotation text. This may be a relative or a full absolute path.

    System.Int32 topTextSpacing

    The top margin of the annotation text in pixels.

    System.Int32 bottomTextSpacing

    The bottom of the annotation text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddAnnotationTextBelowBarcode(String, Int32)

    Annotates the barcode with any string of text.

    the text is rendered below the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddAnnotationTextBelowBarcode(string annotationText, int textSpacing)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    System.Int32 textSpacing

    The top and bottom spacing of the annotation text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddAnnotationTextBelowBarcode(String, Int32, Int32)

    Annotates the barcode with any string of text.

    the text is rendered below the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddAnnotationTextBelowBarcode(string annotationText, int topTextSpacing, int bottomTextSpacing)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    System.Int32 topTextSpacing

    The top margin of the annotation text in pixels.

    System.Int32 bottomTextSpacing

    The bottom of the annotation text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddAnnotationTextBelowBarcode(String, String, Int32)

    Annotates the barcode with any string of text.

    the text is rendered below the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddAnnotationTextBelowBarcode(string annotationText, string fontPath, int textSpacing = 0)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    System.String fontPath

    Path to the Font of the annotation text. This may be a relative or a full absolute path.

    System.Int32 textSpacing

    The top and bottom spacing of the annotation text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddAnnotationTextBelowBarcode(String, String, Int32, Int32)

    Annotates the barcode with any string of text.

    the text is rendered below the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddAnnotationTextBelowBarcode(string annotationText, string fontPath, int topTextSpacing, int bottomTextSpacing)
    Parameters
    Type Name Description
    System.String annotationText

    The annotation text to be displayed.

    System.String fontPath

    Path to the Font of the annotation text. This may be a relative or a full absolute path.

    System.Int32 topTextSpacing

    The top margin of the annotation text in pixels.

    System.Int32 bottomTextSpacing

    The bottom of the annotation text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextAboveBarcode()

    Annotates the barcode with text showing it's value.

    the barcode value is rendered above the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextAboveBarcode()
    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextAboveBarcode(Font, Color)

    Annotates the barcode with text showing it's value.

    the barcode value is rendered above the barcode.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextAboveBarcode(Font fontFace, Color fontColor)
    Parameters
    Type Name Description
    IronSoftware.Drawing.Font fontFace

    The typeface of the barcode value text.

    IronSoftware.Drawing.Color fontColor

    Color of the barcode value text.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextAboveBarcode(Font, Color, Int32)

    Annotates the barcode with text showing it's value.

    the barcode value is rendered above the barcode.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextAboveBarcode(Font fontFace, Color fontColor, int textSpacing)
    Parameters
    Type Name Description
    IronSoftware.Drawing.Font fontFace

    The typeface of the barcode value text.

    IronSoftware.Drawing.Color fontColor

    Color of the barcode value text.

    System.Int32 textSpacing

    The top and bottom spacing of the barcode value text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextAboveBarcode(Font, Color, Int32, Int32)

    Annotates the barcode with text showing it's value.

    the barcode value is rendered above the barcode.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextAboveBarcode(Font fontFace, Color fontColor, int topTextSpacing, int bottomTextSpacing)
    Parameters
    Type Name Description
    IronSoftware.Drawing.Font fontFace

    The typeface of the barcode value text.

    IronSoftware.Drawing.Color fontColor

    Color of the barcode value text.

    System.Int32 topTextSpacing

    The top spacing of the barcode value text in pixels.

    System.Int32 bottomTextSpacing

    The bottom spacing of the barcode value text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextAboveBarcode(Int32)

    Annotates the barcode with text showing it's value.

    the barcode value is rendered above the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextAboveBarcode(int textSpacing)
    Parameters
    Type Name Description
    System.Int32 textSpacing

    The top and bottom spacing of the barcode value text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextAboveBarcode(Int32, Int32)

    Annotates the barcode with text showing it's value.

    the barcode value is rendered above the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextAboveBarcode(int topTextSpacing, int bottomTextSpacing)
    Parameters
    Type Name Description
    System.Int32 topTextSpacing

    The top spacing of the barcode value text in pixels.

    System.Int32 bottomTextSpacing

    The bottom spacing of the barcode value text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextAboveBarcode(String)

    Annotates the barcode with text showing it's value.

    the barcode value is rendered above the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextAboveBarcode(string fontPath)
    Parameters
    Type Name Description
    System.String fontPath

    Path to the Font of the barcode value text. This may be a relative or a full absolute path.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextAboveBarcode(String, Int32)

    Annotates the barcode with text showing it's value.

    the barcode value is rendered above the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextAboveBarcode(string fontPath, int textSpacing)
    Parameters
    Type Name Description
    System.String fontPath

    Path to the Font of the barcode value text. This may be a relative or a full absolute path.

    System.Int32 textSpacing

    The top and bottom spacing of the barcode value text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextAboveBarcode(String, Int32, Int32)

    Annotates the barcode with text showing it's value.

    the barcode value is rendered above the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextAboveBarcode(string fontPath, int topTextSpacing, int bottomTextSpacing)
    Parameters
    Type Name Description
    System.String fontPath

    Path to the Font of the barcode value text. This may be a relative or a full absolute path.

    System.Int32 topTextSpacing

    The top spacing of the barcode value text in pixels.

    System.Int32 bottomTextSpacing

    The bottom spacing of the barcode value text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextBelowBarcode()

    Annotates the barcode with text showing it's value.

    the barcode value is rendered below the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextBelowBarcode()
    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextBelowBarcode(Font, Color)

    Annotates the barcode with text showing it's value.

    the barcode value is rendered below the barcode.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextBelowBarcode(Font fontFace, Color fontColor)
    Parameters
    Type Name Description
    IronSoftware.Drawing.Font fontFace

    The typeface of the barcode value text.

    IronSoftware.Drawing.Color fontColor

    Color of the barcode value text.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextBelowBarcode(Font, Color, Int32)

    Annotates the barcode with text showing it's value.

    the barcode value is rendered below the barcode.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextBelowBarcode(Font fontFace, Color fontColor, int textSpacing)
    Parameters
    Type Name Description
    IronSoftware.Drawing.Font fontFace

    The typeface of the barcode value text.

    IronSoftware.Drawing.Color fontColor

    Color of the barcode value text.

    System.Int32 textSpacing

    The top and bottom spacing for barcode value text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextBelowBarcode(Font, Color, Int32, Int32)

    Annotates the barcode with text showing it's value.

    the barcode value is rendered below the barcode.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextBelowBarcode(Font fontFace, Color fontColor, int topTextSpacing, int bottomTextSpacing)
    Parameters
    Type Name Description
    IronSoftware.Drawing.Font fontFace

    The typeface of the barcode value text.

    IronSoftware.Drawing.Color fontColor

    Color of the barcode value text.

    System.Int32 topTextSpacing

    The top margin of the barcode value text in pixels.

    System.Int32 bottomTextSpacing

    The bottom of the barcode value text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextBelowBarcode(Int32)

    Annotates the barcode with text showing it's value.

    the barcode value is rendered below the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextBelowBarcode(int textSpacing)
    Parameters
    Type Name Description
    System.Int32 textSpacing

    The top and bottom spacing of the barcode value text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextBelowBarcode(Int32, Int32)

    Annotates the barcode with text showing it's value.

    the barcode value is rendered below the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextBelowBarcode(int topTextSpacing, int bottomTextSpacing)
    Parameters
    Type Name Description
    System.Int32 topTextSpacing

    The top spacing of the barcode value text in pixels.

    System.Int32 bottomTextSpacing

    The bottom spacing of the barcode value text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextBelowBarcode(String)

    Annotates the barcode with text showing it's value.

    the barcode value is rendered below the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextBelowBarcode(string fontPath)
    Parameters
    Type Name Description
    System.String fontPath

    Path to the Font of the barcode value text. This may be a relative or a full absolute path.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextBelowBarcode(String, Int32)

    Annotates the barcode with text showing it's value.

    the barcode value is rendered below the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextBelowBarcode(string fontPath, int textSpacing)
    Parameters
    Type Name Description
    System.String fontPath

    Path to the Font of the barcode value text. This may be a relative or a full absolute path.

    System.Int32 textSpacing

    The top and bottom spacing of the barcode value text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    AddBarcodeValueTextBelowBarcode(String, Int32, Int32)

    Annotates the barcode with text showing it's value.

    the barcode value is rendered below the barcode. Overloads of this method allow for the typeface and font size to be specific in detail.

    Declaration
    public GeneratedBarcode AddBarcodeValueTextBelowBarcode(string fontPath, int topTextSpacing, int bottomTextSpacing)
    Parameters
    Type Name Description
    System.String fontPath

    Path to the Font of the barcode value text. This may be a relative or a full absolute path.

    System.Int32 topTextSpacing

    The top spacing of the barcode value text in pixels.

    System.Int32 bottomTextSpacing

    The bottom spacing of the barcode value text in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    ChangeBackgroundColor(Color)

    Sets the background color behind the barcode.

    Declaration
    public GeneratedBarcode ChangeBackgroundColor(Color backgroundColor)
    Parameters
    Type Name Description
    IronSoftware.Drawing.Color backgroundColor

    Color of the background.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    ChangeBarCodeColor(Color, Boolean)

    Sets the barcode color.

    Declaration
    public GeneratedBarcode ChangeBarCodeColor(Color barcodeColor, bool forcedChangeColor = false)
    Parameters
    Type Name Description
    IronSoftware.Drawing.Color barcodeColor

    Color of the barcode (foreground).

    System.Boolean forcedChangeColor

    If ForcedChangeColor is true will skip checking by reading engine. Default is false.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    KeepAspectRatio(Boolean, BarCodeAspectSide)

    Maintain the aspect ratio of the barcode when resizing it.

    Declaration
    public GeneratedBarcode KeepAspectRatio(bool keepAspectRatio, BarCodeAspectSide barCodeAspectSide)
    Parameters
    Type Name Description
    System.Boolean keepAspectRatio

    Is Keep Aspect Ratio.

    BarCodeAspectSide barCodeAspectSide

    Side (Horizontal / Vertical) that need to keep. (Default is Horizontal)

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    Remarks

    Works only for PDF417.

    ResizeTo(Int32, Int32)

    Resizes the Barcode (excluding annotations and margins). This process causes a re-render and is lossless.

    Declaration
    public GeneratedBarcode ResizeTo(int maxWidth, int maxHeight)
    Parameters
    Type Name Description
    System.Int32 maxWidth

    The maximum width of the barcode in px. May be ignored if the value is too small for the barcode to be read.

    System.Int32 maxHeight

    The maximum height of the barcode in px.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    ResizeToMil(Double, Double, Int32)

    Resize the barcode using the specified 'mil' width (thousandths of an inch)

    Declaration
    public GeneratedBarcode ResizeToMil(double milWidth, double inchHeight = 1, int DPI = 96)
    Parameters
    Type Name Description
    System.Double milWidth

    The width of the narrowest barcode element, in thousandths of an inch.

    System.Double inchHeight

    The height of the barcode in inch. (Default is 1 inch)

    System.Int32 DPI

    Dots-per-inch (Default is 96)

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    SaveAsGif(String)

    Saves the barcode as a GIF image file.

    Declaration
    public GeneratedBarcode SaveAsGif(string filePath)
    Parameters
    Type Name Description
    System.String filePath

    The file path for the GIF.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    SaveAsHtmlFile(String)

    Saves the Barcode as fully functional and self-contained HTML file.

    The image encoding will automatically match the file extension specified in your ImagePath. Defaults to Bitmap image encoding if ambiguous.

    Declaration
    public GeneratedBarcode SaveAsHtmlFile(string htmlFilePath)
    Parameters
    Type Name Description
    System.String htmlFilePath

    The file path where the HTML document will be saved.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    See Also
    ToHtmlTag()

    SaveAsImage(String)

    Saves the Barcode as an image file.

    The image encoding will automatically match the file extension specified in your ImagePath. Defaults to Bitmap image encoding if ambiguous.

    Declaration
    public GeneratedBarcode SaveAsImage(string imagePath)
    Parameters
    Type Name Description
    System.String imagePath

    The file path where the image will be saved to disk.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    SaveAsJpeg(String)

    Saves the barcode as a JPEG image file.

    Declaration
    public GeneratedBarcode SaveAsJpeg(string filePath)
    Parameters
    Type Name Description
    System.String filePath

    The file path for the JPEG.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    SaveAsPdf(String)

    Saves the barcode as a new PDF document.

    Declaration
    public GeneratedBarcode SaveAsPdf(string filePath)
    Parameters
    Type Name Description
    System.String filePath

    The file path for the PDF.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    SaveAsPng(String)

    Saves the barcode as a PNG image file.

    Declaration
    public GeneratedBarcode SaveAsPng(string filePath)
    Parameters
    Type Name Description
    System.String filePath

    The file path for the PNG.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    SaveAsTiff(String)

    Saves the barcode as a TIFF image file.

    Declaration
    public GeneratedBarcode SaveAsTiff(string filePath)
    Parameters
    Type Name Description
    System.String filePath

    The file path for the TIFF.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    SaveAsWindowsBitmap(String)

    Saves the barcode as a BMP image file.

    Declaration
    public GeneratedBarcode SaveAsWindowsBitmap(string filePath)
    Parameters
    Type Name Description
    System.String filePath

    The file path for the BMP.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    SetMargins(Int32)

    Sets whitespace margins around the barcode.

    Declaration
    public GeneratedBarcode SetMargins(int pixelWidth)
    Parameters
    Type Name Description
    System.Int32 pixelWidth

    Width of margins in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    SetMargins(Int32, Int32, Int32, Int32)

    Sets whitespace margins around the barcode.

    Declaration
    public GeneratedBarcode SetMargins(int top, int right, int bottom, int left)
    Parameters
    Type Name Description
    System.Int32 top

    The top margin in pixels.

    System.Int32 right

    The right margin in pixels.

    System.Int32 bottom

    The bottom in pixels.

    System.Int32 left

    The left margin in pixels.

    Returns
    Type Description
    GeneratedBarcode

    This instance of GeneratedBarcode.

    StampToExistingPdfPage(String, Int32, Int32, Int32, String)

    Stamps (draws) the Barcode onto an existing page of an existing PDF document.

    Declaration
    public GeneratedBarcode StampToExistingPdfPage(string PdfFilePath, int x, int y, int pageNumber = 1, string password = null)
    Parameters
    Type Name Description
    System.String PdfFilePath

    The file path of the PDF which will have the Barcode added to it..

    System.Int32 x

    The horizontal position of the barcode on the PDF page in pixels

    System.Int32 y

    The vertical position of the barcode on the PDF page in pixels

    System.Int32 pageNumber

    The page of the PDF to stamp. [One Based] such that the first page is number 1 rather than 0.

    System.String password

    The PDF encryption or administrator password if this PDF is digitally protected from modification or opening.

    Returns
    Type Description
    GeneratedBarcode

    StampToExistingPdfPages(String, Int32, Int32, IEnumerable<Int32>, String)

    Stamps (draws) the Barcode onto multiple existing pages of an existing PDF document.

    Declaration
    public GeneratedBarcode StampToExistingPdfPages(string pdfFilePath, int x, int y, IEnumerable<int> pageNumbers, string password = null)
    Parameters
    Type Name Description
    System.String pdfFilePath

    The file path of the PDF which will have the Barcode added to it..

    System.Int32 x

    The horizontal position of the barcode on each PDF page in pixels

    System.Int32 y

    The vertical position of the barcode on each PDF page in pixels

    System.Collections.Generic.IEnumerable<System.Int32> pageNumbers

    The page numbers of the PDF to stamp as an enumeration, list or array. [One Based] such that the first page is number 1 rather than 0.

    System.String password

    The PDF encryption or administrator password if this PDF is digitally protected from modification or opening.

    Returns
    Type Description
    GeneratedBarcode

    ToBitmap()

    Returns the barcode as an IronSoftware.Drawing.AnyBitmap

    Declaration
    public AnyBitmap ToBitmap()
    Returns
    Type Description
    IronSoftware.Drawing.AnyBitmap

    A IronSoftware.Drawing.AnyBitmap

    ToDataUrl()

    Converts the barcode to a base64 data URL.

    The data URI scheme is a uniform resource identifier (URI) scheme that provides a way to include data in-line in web pages as if they were external resources.

    https://en.wikipedia.org/wiki/Data_URI_scheme

    Declaration
    public string ToDataUrl()
    Returns
    Type Description
    System.String

    The Data URL as a string.

    See Also
    ToHtmlTag()
    SaveAsHtmlFile(String)

    ToGifBinaryData()

    Returns the barcode as the binary data for a GIF image.

    Declaration
    public byte[] ToGifBinaryData()
    Returns
    Type Description
    System.Byte[]

    A byte array

    ToGifStream()

    Returns the barcode as a System.IO.MemoryStream of the binary data for a GIF image.

    Declaration
    public MemoryStream ToGifStream()
    Returns
    Type Description
    System.IO.MemoryStream

    System.IO.Stream

    ToHtmlTag()

    Renders the barcode as a HTML image Tag. The tag is fully formed (using a data-url> and can be injected into HTML with no JS, CSS or image dependencies.

    Declaration
    public string ToHtmlTag()
    Returns
    Type Description
    System.String

    An Html img tag as a string.

    ToImage()

    Returns the barcode as an IronSoftware.Drawing.AnyBitmap

    Declaration
    public AnyBitmap ToImage()
    Returns
    Type Description
    IronSoftware.Drawing.AnyBitmap

    A IronSoftware.Drawing.AnyBitmap

    ToJpegBinaryData()

    Returns the barcode as the binary data for a JPEG/JPG image.

    Declaration
    public byte[] ToJpegBinaryData()
    Returns
    Type Description
    System.Byte[]

    A byte array

    ToJpegStream()

    Returns the barcode as a System.IO.MemoryStream of the binary data for a JPEG/JPG image.

    Declaration
    public MemoryStream ToJpegStream()
    Returns
    Type Description
    System.IO.MemoryStream

    System.IO.Stream

    ToPdfBinaryData()

    Returns a 1 page PDF document containing the barcode, as binary data.

    Declaration
    public byte[] ToPdfBinaryData()
    Returns
    Type Description
    System.Byte[]

    A byte array.

    ToPdfStream()

    Returns a binary System.IO.MemoryStream containing a 1 page PDF document containing the barcode, as binary data.

    Declaration
    public Stream ToPdfStream()
    Returns
    Type Description
    System.IO.Stream

    A System.IO.Stream

    ToPngBinaryData()

    Returns the barcode as the binary data for a PNG image.

    Declaration
    public byte[] ToPngBinaryData()
    Returns
    Type Description
    System.Byte[]

    A byte array

    ToPngStream()

    Returns the barcode as a System.IO.MemoryStream of the binary data for a PNG image.

    Declaration
    public MemoryStream ToPngStream()
    Returns
    Type Description
    System.IO.MemoryStream

    System.IO.Stream

    ToStream()

    Renders the barcode as an image System.IO.Stream

    Declaration
    public MemoryStream ToStream()
    Returns
    Type Description
    System.IO.MemoryStream

    A System.IO.MemoryStream containing encoded image file data. The default encoding is PNG

    ToStream(AnyBitmap.ImageFormat)

    Renders the barcode as an image System.IO.Stream

    Declaration
    public MemoryStream ToStream(AnyBitmap.ImageFormat imageFormat)
    Parameters
    Type Name Description
    IronSoftware.Drawing.AnyBitmap.ImageFormat imageFormat

    (optional) The image format as a IronSoftware.Drawing.AnyBitmap.ImageFormat.

    Returns
    Type Description
    System.IO.MemoryStream

    A System.IO.MemoryStream containing encoded image file data

    ToString()

    Returns a System.String that represents this GeneratedBarcodes value.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    A System.String that represents this instance.

    ToTiffBinaryData()

    Returns the barcode as the binary data for a TIFF image.

    Declaration
    public byte[] ToTiffBinaryData()
    Returns
    Type Description
    System.Byte[]

    A byte array

    ToTiffStream()

    Returns the barcode as a System.IO.MemoryStream of the binary data as the binary data for a TIFF image.

    Declaration
    public MemoryStream ToTiffStream()
    Returns
    Type Description
    System.IO.MemoryStream

    System.IO.Stream

    ToWindowsBitmapBinaryData()

    Returns the barcode as the binary data for a Bitmap BMP image.

    Declaration
    public byte[] ToWindowsBitmapBinaryData()
    Returns
    Type Description
    System.Byte[]

    A byte array

    ToWindowsBitmapStream()

    Returns the barcode as a System.IO.MemoryStream of the binary data for a Bitmap BMP image.

    Declaration
    public Stream ToWindowsBitmapStream()
    Returns
    Type Description
    System.IO.Stream

    System.IO.Stream

    Verify(String)

    Verifies this barcode is still readable by IronBarCode.

    Resizing a barcode to a very small size using unconventional colors may make it unreadable to a machine. This method verifies that a barcode is still fully readable.

    Declaration
    public bool Verify(string expected = null)
    Parameters
    Type Name Description
    System.String expected
    Returns
    Type Description
    System.Boolean

    true if the barcodes is still machine-readable

    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    Want to deploy IronBarcode to a live project for FREE?
    What’s included?
    30 days of fully-functional product
    Test and share in a live environment
    No watermarks in production
    Get your free 30-day Trial Key instantly.
    No credit card or account creation required
    Your Trial License Key has been emailed to you.
    Download IronBarcode free to apply
    your Trial Licenses Key
    Install with NuGet View Licenses
    Licenses from $499. Have a question? Get in touch.