C# Class ApiExamples.CustomBarcodeGenerator

Sample of custom barcode generator implementation (with underlying Aspose.BarCode module)
Inheritance: IBarcodeGenerator
Datei anzeigen Open project: aspose-words/Aspose.Words-for-.NET

Public Methods

Method Description
CastDoubleToInt ( double value ) : int

Casts a double to int32 in a way that uint32 are "correctly" casted too (they become negative numbers).

GetBarcodeImage ( BarcodeParameters parameters ) : Image

Implementation of the GetBarcodeImage() method for IBarCodeGenerator interface.

GetOldBarcodeImage ( BarcodeParameters parameters ) : Image

Implementation of the GetOldBarcodeImage() method for IBarCodeGenerator interface.

TryParseHex ( string s ) : int

Try parses a hex string into an integer value. on error return int.MinValue

TryParseInt ( string s ) : int

Parses an integer using the invariant culture. Returns Int.MinValue if cannot parse. Allows leading sign. Allows leading and trailing spaces.

Private Methods

Method Description
ConvertBarcodeType ( string inputCode ) : Symbology

Converts barcode type from Word to Aspose.BarCode.

ConvertColor ( string inputColor ) : Color

Converts barcode image color from Word to Aspose.BarCode.

ConvertScalingFactor ( string scalingFactor ) : float

Converts bar code scaling factor from percents to float.

ConvertSymbolHeight ( string heightInTwipsString ) : float

Converts barcode image height from Word units to Aspose.BarCode units.

Method Details

CastDoubleToInt() public static method

Casts a double to int32 in a way that uint32 are "correctly" casted too (they become negative numbers).
public static CastDoubleToInt ( double value ) : int
value double
return int

GetBarcodeImage() public method

Implementation of the GetBarcodeImage() method for IBarCodeGenerator interface.
public GetBarcodeImage ( BarcodeParameters parameters ) : Image
parameters BarcodeParameters
return Image

GetOldBarcodeImage() public method

Implementation of the GetOldBarcodeImage() method for IBarCodeGenerator interface.
public GetOldBarcodeImage ( BarcodeParameters parameters ) : Image
parameters BarcodeParameters
return Image

TryParseHex() public static method

Try parses a hex string into an integer value. on error return int.MinValue
public static TryParseHex ( string s ) : int
s string
return int

TryParseInt() public static method

Parses an integer using the invariant culture. Returns Int.MinValue if cannot parse. Allows leading sign. Allows leading and trailing spaces.
public static TryParseInt ( string s ) : int
s string
return int