Properties of ASPXBarCode COM interface
BackColor
BackStyle
barAutoStructureAppend
barBottomComment
barBottomFont
barBorder
barBoundaryHeight
barBoundaryWidth
barCDEnable
barCheckDigits
barColor
barCommentAlign
barEscapeProcessing
barHeight
barHRDisplay
barNarrowWidth
barMessage
barMessageFont
barOrientation
barQuietZone
barPicture
barRatio
barStructureAppendID
barStructureAppendTotalNumber
barStructurePositionIndex
barSupplement
barSymbology
barTopComment
barTopFont
barTruncatedLength
bar128StartType
BackColor
A property for background color. If
BackStyle is Opaque, ASPXBarCode uses this color to draw the background,
otherwise the BackColor is ignored.
BackStyle
A property for background style. If set to transparent ASPXBarCode paint transparently; if set to Opaque ASPXBarCode fills background with BackColor.
Note:
Transparent mode is unavailable if bar code is rotated(degree 90, degree 180, degree 270) and one of the fonts selected for message, top comment and bottom font is not truetype.
barAutoStructureAppend
A
property specifying if automatic sturcture append is applied. The
property is only valid when barSymbology is set to the 2D symbologies,
such as BarPDF417, BarMaxiCode, BarDataMatrix, BarQRCode,
BarAztecMesas, BarMicroPDF417. When it is set to true, ASPXBarCode will automatically create multiple blocks of barcodes if necessary based on the structure append.
barBottomComment
A property for bottom comment. It supports multiple lines by using \r\n. The comment is drawn using barBottomFont
barBottomFont
A property for the font of bottom comment. ASPXBarCode can draw rotated text even the font is not truetype
barBorder
A property for border style of the boundary. There are five options
Enumerate
Constants
Values
Comments
NoBorder
0
No border is drawn
SBrokenLines
1
A square is drawn in broken line with width of 10 mils
DBrokenLines
2
A square is drawn in broken line with width of 20 mils
SSolidLines
3
A square is drawn in solid line with width of 10 mils
DSolidLines
4
A square is drawn in solid line with width of 20
mils
barBoundaryHeight
A read only property for boundary height. The boundary height is the minimum height calculated based on other properties such as barHeight, barTopFonts, barBottomFonts,etc. The value is in
mils
barBoundaryWidth
A read only property for boundary width. The boundary
width is the minimum width calculated based on other properties such as
barNarrowWidth, barRatio, barTopFonts,
barBottomFonts, etc. The value is in mils
barCheckDigits
A read only property for check digits
barBearerMode
A property to specify if bearer bars should
included. This property is valid only in linear symbologies.
barCDEnable
A property for check digits. If set to true, check digits are added into message.
Note: barCDEnable is only used for Interleaved 2 of 5, EAN 128, Code 39, Ext
Code 39. barCDEnable is always true for other symbologies.Check digits of Code 39 and Ext Code 39 are used for
HP.
barColor
A property for bar color and bar message and comments
A property for align style of top comments and bottom comments. Possible values are
Enumerate Constants | Values | Comments |
AlignCenter | 0 | top comments and bottom comments are center aligned |
AlignLeft | 1 | top comments and bottom comments are left aligned |
AlignRight | 2 | top comments and bottom comments are right aligned |
barEscapeProcessing
A
property for specifying if the special escape character "^" is to be processed
in the barMessage for any binary data(0-255) and special function
codes. If the barEscapeProcessing is set to true, the "^" is
processed. "^" followed by three decimal digits
will stand for a binary data(0-255). For example, "^009" represents
a tab key, "^013" represents the carriage, and
"123456^0097890" represents "123456" followed by a tab
character which is followed by "7890". If the message
itself has the character "^", you need to put a "^" before it. For
example, the "123456^^^0097890" represents "123456" followed by a "^" and a tab key, then "7890". The property is only valid in 2D symbologies. Please check PDF 417, Micro PDF 417, DataMatrix, MaxiCode, QRCode, AztecMesas for the speical function codes.
barHeight
A property for bar height in mils. ASPXBarCode compares the property value with the specification related to the selected symbology. If the value does not meet the specifiation, ASPXBarCode will select the minimum value automatically. barHeight is not valid in 2D symbologies.
barHRDisplay
A property for displaying human readable text. If it is
true, the human readable text is displayed, otherwise not shown. For some symbologies such as UPC A, UPC E, EAN 13, EAN 8, JAN 13, JAN 8, barHRDisplay is always true.
barNarrowWidth
A property for specifying the width of narrow bar in
mils. The width of the barcode is determined by the value of barNarrowWidth and the content of barMessage. ASPXBarCode compares the property value with the specification related to the selected symbology. If the value does not meet the specifiation, ASPXBarCode will select the minimum value automatically.
barMessage
A property for message of the selected symbology.
ASPXBarCode checks the
message and calcuate the
check
digits
if necessary. It also trim space characters automatically
for some symbologies for you. In case of symbology EAN 128, the message can contain special FNC1(binary 134) to concantenate multiple
AI fields. If the message is invalid, ASPXBarCode sets the boundary
rectangle blank and display "Message Incorrect". Use method IsMessageValid to check
if message is valid. Some symbologies only support a limited character
sets; some symbologies support all the ASCII codes; some symbologies support any kind of data. If you want to put a
unprintalbe character in the barMessage, you can always use the method(function) provided in the development language. The following table explains how to embed a tab character(ASCII code 9) between "12345" and "67890" in VB, VB.Net, VC++, C++.Net, C#.Net, VBScript. Similarly, you can put carriage return, feed and other characters.
Language | Code Snippets |
VB | barcodeobj.barMessage = "12345" + Chr$(9) + "67890" |
VB Script | barcodeobj.barMessage = "12345" + Chr(9) + "67890" |
VB.Net | barcodeobj.barMessage ="12345"+Chr(9) + "67890" |
C#.Net | barcodeobj.barMessage="12345" +"\t" + "67890" |
barMessageFont
A
property for the font of the barMessage. ASPXBarCode can draw rotated text even the font is not true type
barOrientation
A property for the orientation of the bar code. Possible values are
Enumerate Constants | Values | Comments |
Degree0 | 0 | no rotation |
Degree90 | 90 | rotate 90 clockwise |
Degree180 | 180 | rotate 180 clockwise |
Degree270 | 270 | rotate 270 clockwise |
barQuietZone
A property specifying the quiet zone in mils. ASPXBarCode compares the property value with the specification related to the selected symbology. If the value does not meet the specification, ASPXBarCode will select the minimum value automatically.
barPicture
A picture property. With picture property, VB user can easily put ASPXBarCode in other components
barRatio
A property
specifying the ratio of wide bar over narrow bar. The property is
valid for Code 11, Codabar, MSI, Code 39, Ext Code 39, and Interleaved 2 of 5
barStructureAppendID
A
property specifying the identifier for the sturcture append. The
property is
only valid when barSymbology is set to the 2D symbologies, such as BarPDF417, BarMaxiCode, BarDataMatrix, BarQRCode, BarAztecMesas, BarMicroPDF417.
barStructureAppendTotalNumber
A property specifying the total number of the
barcode blocks in the sturcture append.
The property is only valid when barSymbology is set
to the 2D symbologies, such as BarPDF417, BarMaxiCode,
BarDataMatrix, BarQRCode, BarAztecMesas, BarMicroPDF417. The following table shows the maximum total numbers for different barcode symbolgies.
Barcode Symbology | Maximum number of structure append |
PDF417(Macro PDF417) Micro PDF417 | 16 |
DataMatrix | 16 |
MaxiCode | 8 |
QRCode | 16 |
AztecMesas | 26 |
barStructurePositionIndex
A property specifying the index of the barcode
blocks in the sturcture append.
The property is only valid when barSymbology
is set to the 2D symbologies, such
as BarPDF417, BarMaxiCode, BarDataMatrix, BarQRCode, BarAztecMesas, BarMicroPDF417. The following table shows the value ranges for different barcode symbologies.
Barcode Symbology | Index Range |
PDF 417(Macro PDF 417), Micro PDF 417 | From 0 to 15 |
DataMatrix | From 1 to 16 |
MaxiCode | From 1 to 8 |
QRCode | From 1 to 16 |
AztecMesas | From 1 to 26 |
barSupplement
A property specifying supplement text. The property is
only valid for UPC A,
UPC E, EAN 13, EAN 8, JAN 13, and JAN 8
barSymbology
A property specifying the symbology of bar code. It should be one of the following values
Enumerate Constants | Values | Comments |
Bar11 | 0 | for Code 11 |
CodaBar | 1 | for Codabar |
BarMSI | 2 | for MSI |
Bar39 | 3 | for Code 39 |
ExtBar39 | 4 | for Extended Code 39 |
Bar93 | 5 | for Code 93 |
Bar128 | 6 | for Code 128(A,B,C) |
BarEAN128 | 7 | for EAN 128 |
BarUPCA | 8 | for UPCA |
BarUPCE | 9 | for UPCE |
BarEAN13 | 10 | for EAN 13 |
BarEAN8 | 11 | for EAN 8 |
BarJAN13 | 12 | for JAN 13 |
BarJAN8 | 13 | for JAN 8 |
BarHIBCLic39 | 14 | for HIBC(using Code 39) |
BarHIBCLic128 | 15 | for HIBC(using Code 128) |
BarHIBCEAN128 | 16 | for HIBC(using EAN 128) |
BarHIBCIn25 | 17 | for HIBC(using Interleaved 2 of 5) |
Bar25 | 18 | for Interleaved 2 of 5 |
BarPostNet | 19 | for PostNet |
BarSCC14E | 20 | for SCC14(using EAN128) |
BarSCC14I | 21 | for SCC14(using Interleaved 2 of 5) |
BarPDF417 | 22 | for PDF 417(Also supports Macro PDF417) |
BarMaxiCode | 23 | for MaxiCode |
BarDataMatrix | 24 | for DataMatrix |
BarQRCode | 25 | for QRCode |
BarAztecMesas | 26 | for Aztec Mesas |
BarMicroPDF417 | 27 | for Micro PDF417 |
barTopComment
A property for top comment. It supports multiple lines by using \r\n. The comment is drawn using barTopFont
barTopFont
A property for the font of top comment. ASPXBarCode can draw rotated text even the font is not truetype
barTruncatedLength
A
property specifying the truncated length. It is valid only in 2D
barcodes and it is read only. If the barMessage is too
long to be coded in the barcodes, barTruncatedLength
shows how many characters are remained.
bar128StartType
A property for selecting start type in Code 128, EAN 128. It must be one of the following values.
Enumerate Constants | Values | Comments |
Code128StartA | 0 | Start type is A |
Code128StartB | 1 | Start Type is B |
Code128StartC | 2 | Start Type is C |
Code128AutoSelect | 3 | Select the type from A,B,C that has smallest width |
bool
AddECIData ((BSTR
bsECI) )
Barcode Symbology | How to Specify ECI Data in bsECI |
PDF 417(Macro PDF 417), Micro PDF 417 | "XXXXXX" |
DataMatrix | "XXXXXX" |
MaxiCode | "XXXXXX" |
QRCode |
"eXXXXXX" for basic
ECI "bXXXXXX" for nest ECI begin "fXXXXXX" for nest ECI end |
AztecMesas | "XXXXXX" |
return: a boolean value
VARIANT
ReadBinary()
BarError SaveAsMetaFile
(String bsFileName)
SaveAsPngImage(String bsFileName)
// Create images. Refer detailed codes in the file coding.aspx.cs
Response.Expires = 0;
Response.Buffer = true;
Response.Clear;
'Change the HTTP header to reflect that an image is being passed.
Response.ContentType = "image/png";
//Get ASP-XBarCode object from the Session
ASPXBARCODELib.ASPBarCodeClass barcodeobj =(ASPXBARCODELib.ASPBarCodeClass)Session["BarcodeObj"];
//Output image
object bar =barcodeobj.ReadBinary();
Response.BinaryWrite((byte[])bar);
Response.End();
2> Add the sample code to your existing project. Please copy all the files and sub-folders under the directory ASPBarcodeNetCSharpDemo to your local system. Open your project, in the Project Explorer, right click the project, then click "Add", then "Add Existing Item...", go to the ASPBarCodeNetCSharpDemo directory from the file choser dialog, select barcodenetdemo.htm, barcodedemo.aspx, coding.aspx. Finally, you need to add ASPXBarCode reference in your project. To add the reference, right click on "References", then click "Add Reference", click tab "Com" in the popup dialog, highlight the "ASPXBarCode 2.2 Type Library" from the COM component list, then click ", then click "select", and click button "OK".