BarCodeGenerator Class
BarCodeGenerator for backend barcode images generation.

supported symbology: 1D: Codabar, Code11, Code128, Code39Standard, Code39Extended Code93Standard, Code93Extended, EAN13, EAN8, Interleaved2of5, MSI, Standard2of5, UPCA, UPCE, ISBN, GS1Code128, Postnet, Planet EAN14, SCC14, SSCC18, ITF14, SingaporePost ... 2D: Aztec, DataMatrix, PDf417, QR code ...

Inheritance Hierarchy

Namespace: Aspose.BarCode.Generation
Assembly: Aspose.BarCode (in Aspose.BarCode.dll) Version: 18.11
Syntax
public sealed class BarCodeGenerator : Component

The BarCodeGenerator type exposes the following members.

Constructors
  NameDescription
Public methodBarCodeGenerator(BaseEncodeType)
Initializes a new instance of the BarCodeGenerator class with default codetext.
Public methodBarCodeGenerator(BaseEncodeType, String)
Initializes a new instance of the BarCodeGenerator class.
Properties
  NameDescription
Public propertyAustralianPostEncodingTable
Interpreting type for the Customer Information of AustralianPost, default to CustomerInformationInterpretingType.Other"
Public propertyCode exampleAutoSizeMode
Gets or sets the mode by which the barcode automatically resizes. Default value is AutoSizeMode.None.
Public propertyCode exampleAztec
Gets the AztecProperties that contains all configuration properties for Aztec barcode.
Public propertyBackColor
Background color of the barcode image. See Color.
Public propertyBarCodeHeight
BarCode height when AutoSizeMode property is set to AutoSizeMode.Nearest.
Public propertyBarCodeWidth
BarCode width when AutoSizeMode property is set to AutoSizeMode.Nearest.
Public propertyCode exampleBarHeight
Height of 1D barcodes' bars in Unit value.
Public propertyCode exampleBorder
Gets the BorderProperties that contains all configuration properties for barcode border.
Public propertyCode exampleCaptionAbove
Caption Above the BarCode image. See Caption.
Public propertyCode exampleCaptionBelow
Caption Below the BarCode image. See Caption.
Public propertyCode exampleChecksum
Gets the ChecksumProperties that contains all configuration properties for checksum of barcode.
Public propertyCode exampleCodabar
Gets the CodabarProperties that contains all configuration properties for Codabar barcode.
Public propertyCode exampleCodeText
Data to be encoded, different types of BarCode may have different CodeText length restrictions. See CodeTextStyle.
Public propertyCode exampleCodeTextStyle
Gets the CodeTextStyle that contains all configuration properties for codetext of barcode.
Public propertyContainer
Gets the IContainer that contains the Component.
(Inherited from Component.)
Public propertyCode exampleD2
Gets the D2Properties that contains all configuration properties for 2D barcodes.
Public propertyCode exampleDataMatrix
Gets the DataMatrixProperties that contains all configuration properties for DataMatrix barcode.
Public propertyDotCodeMask
Mask of Dotcode barcode, default to Auto.
Public propertyEnableEscape
Indicates whether explains the character "\" as an escape character in CodeText property. It is worked pdf417, DataMatrix, Code128 only See CodeText. If the EnableEscape is true, "\" will be explained as a special escape character. Otherwise, "\" acts as normal characters.
Remarks
Aspose.BarCode supports inputing decimal ascii code and mnemonic for ASCII control-code characters. For example, \013 and \\CR stands for CR.
Public propertyCode exampleEncodeType
BarCode's encode type (symbology). Use EncodeTypes to get current symbology.
Public propertyFilledBars
Gets or sets a value indicating whether bars filled. Only for 1D barcodes. Default value is true.
Public propertyForeColor
Foreground color of the barcode image, that is, Bar's color of 1D barcode, Module's color of 2D barcode. See Color.
Public propertyIsLicensed
Gets a value indicating whether generation module is licensed.
Public propertyCode exampleITF
Gets the ITFProperties that contains all configuration properties for ITF14 barcode.
Public propertyCode exampleMargins
Margin area around the core BarCode image.
Public propertyMaxiCodeEncodeMode
Gets or sets a MaxiCode encode mode.
Public propertyCode examplePdf417
Gets the Pdf417Properties that contains all configuration properties for Pdf417 barcode.
Public propertyPostalShortBarHeight
Short bar's height of Postal barcodes.
Public propertyCode exampleQR
Gets the QRProperties that contains all configuration properties for QR barcode.
Public propertyResolution
Gets or sets the resolution of the BarCode image. One value for both dimensions.
Public propertyCode exampleRotationAngle
BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image.
Public propertySite
Gets or sets the ISite of the Component.
(Inherited from Component.)
Public propertyCode exampleSupplement
Gets the SupplementProperties that contains all configuration properties for Supplement part of barcode.
Public propertyThrowExceptionWhenCodeTextIncorrect
Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingapurePost, Code39Extended, Code93Extended, Code16K, Code128 symbology if codetext is incorrect.
Public propertyWideNarrowRatio
Wide bars to Narrow bars ratio for some 1D BarCode. Default WideNarrowRatio is 3, that is, wide bars are 3 times as wide as narrow bars. Applicable symbology: Code39Extended, Code39Standard, Standard2of5, Interleaved2of5, Pharmacode
Public propertyCode exampleXDimension
x-dimension is the smallest width of the unit of BarCode bars or spaces. Increase this will increase the whole barcode image width.
Methods
  NameDescription
Public methodCreateObjRef
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject.)
Public methodDispose
Releases all resources used by the Component.
(Inherited from Component.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodCode exampleGenerateBarCodeImage
Generate the BarCode image under current settings.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLifetimeService
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Public methodInitializeLifetimeService
Obtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Public methodCode exampleRecalculateValues
Calculate all values automatically without drawing barcode.
Public methodSave(String)
Save BarCodeImage to specific file in specific format.
Public methodSave(Stream, BarCodeImageFormat)
Save BarCodeImage to stream in specific format.
Public methodSave(String, BarCodeImageFormat)
Save BarCodeImage to specific file in specific format.
Public methodToString
Returns a String containing the name of the Component, if any. This method should not be overridden.
(Inherited from Component.)
Events
  NameDescription
Public eventDisposed
Occurs when the component is disposed by a call to the Dispose method.
(Inherited from Component.)
Examples
This sample shows how to create and save a BarCode image.
[C#]
  using(BarCodeGenerator generator = new BarCodeGenerator(EncodeTypes.Code128))
  {
      generator.CodeText = "123ABC";
      generator.Save("code128.png");
  }
See Also