Logo
flag german flag uk flag us Tip: Bookmark this page with Ctrl-D (Win) or Apple-D (Mac) MainProductsKnow How / FAQStoreContact

Manual - .NET Barcode Library - Reference Section

Current version: V2.0 - If you are still using V1.x please contact us for an upgrade. Have the order number / purchase date ready.

Properties (in alphabetical order, read-only properties are in orange)

Name Type Comment
General
Checksum Boolean False: Don't calculate checksum. True: Calculate checksum.

Applies only to the following codes: Code 39, Code 2/5 Interleaved, Code 2/5 Industrial. Ignored for all other codes which are either always without (Codabar, PZN, Laetus) or always with checksum (all others).

Default: True
 
CurrentCode Integer The current barcode symbology.

CODE_EAN81000
CODE_EAN131001
CODE_ISBN101002
CODE_ISBN131003
CODE_UPCA1004
CODE_UPCE1005
CODE_1281006
CODE_128GS11007
CODE_25IL1008
CODE_25IND1009
CODE_391010
CODE_PZN1011
CODE_LAETUS1012
CODE_CODABAR1013
CODE_DATAMATRIX1014
CODE_PDF4171015
CODE_QR1016
CODE_DATABAR1017

Default: CODE_EAN13

Note: When setting the code type to Databar you must also set the DatabarSubType property, see below.
 
DataToEncode String Data to encode in the barcode. String can have up to 4096 characters (the practical limit for ordinary linear codes is 40, though). See section below for a list what the control expects for the various symbologies.

To encode non-printable charaters, e.g. a TAB, use the tilde, followed by the ASCII code, left padded with "0" to three digits. E.g. to encode a TAB, write "~009". To encode an FNC1 character (if you want to assemble your own Code 128 GS1 symbols), write "~999". To encode a tilde, write "~0126".

Note: When encoding non-printable characters make sure your scanner can actually read and transmit such data - this is not a given, especially if the scanner emulates a keyboard, e.g. via a wedge or USB. In many cases you will need to use a scanner that is connected via the serial port.

Default: "401234567890"
 
ModuleHeight Float Height of the barcode in mm. Ignored for EAN Family barcodes (see CurrentEANSize property below), Databar GS1, and 2D matrix symbologies.

The smallest acceptable value depends on the application, values under 8 mm should be avoided, for Code 128 GS1 the value should be 32 mm.

Default: 25 mm
 
ModuleWidth Float Width of the smallest bar (= module) in mm. Ignored for EAN Family barcodes (see CurrentEANSize property below).

The smallest acceptable value depends on the print resolution, avoid values under 0.1 mm. For Databar GS1 and Code 128 GS1 the value should be between 0.495 and 1.016 mm.

Default: 0.5 mm
 
Ratio Float Ratio of the width of the wide bar to the width of the narrow bar. For 2-width codes (Code 39, Code 2/5) only. Ignored for all other codes.

The smallest acceptable value depends on the print quality and the resolution of the scanner; a ratio of 3 results in a low-density code, a ratio of 2 results in a high-density code. Values under 2 should be avoided.

Default: 3
 
Human Readable Part
HumanReadable Boolean Display human readable text under the barcode. Ignored for all 2D symbologies and ISBN family. ISBN barcodes are standardized and always come with text.

Default: True
 
HumanReadableFont String Name of the font to use for the human readable text.

Default: "Arial"
 
HumanReadableSize Float Size of the font for the human readable text in points. Ignored for EAN Family codes where the font size depends on the code size.

Default: 12 pt.
 
License
License String The license of the control. Can return the following three values:

Trial - for the demo version of the library
InHouse - for the inhouse license of the library
Redistribution - for the redistribution license of the library

In the latter two cases the name of the licensee (and their company if applicable) will also be part of the returned string, e.g. "Redistribution - Licensed to Wile E. Coyote, Acme Mfg. Co., Feb. 28, 2010".

Default: n/a
 
Output
MarginX Float Left and right margin of the barcode. Should not be under 5 mm.

Default: 5 mm
 
MarginY Float Top and bottom margin of the barcode. Should not be under 5 mm.

Default: 5 mm
 
Reduction Float Reduce bar width to compensate for ink spread (dot gain). Between 0% and 80%. For ordinary office laser printers a value of 10% is recommended.

Default: 0 %
 
EPS String A string containing the EPS (Encapsulated PostScript) representation of the barcode (see C# barcode sample walkthrough for example usage)

Default: n/a
 
Specific (EAN)
CurrentEANReduce Float Reduce the height of an EAN symbol. Between 0% (no height reduction) and 80%.

Default: 0 %
 
CurrentEANSize Int Required EAN SC size. Between 0 (circa 81%) and 9 (200%). A value of 2 corresponds to the 100% SC 2 size with a module width of 0.33mm.

Default: 2
 
Specific (Databar GS1)
DatabarSubType Int The Databar sub type.

GS1_DB_OMNI0
GS1_DB_STACKED_OMNI1
GS1_DB_EXPANDED2
GS1_DB_EXPANDED_STACKED3
GS1_DB_TRUNCATED4
GS1_DB_STACKED5
GS1_DB_LIMITED6

Default: GS1_DB_EXPANDED
 
SymbolsPerRow Int Symbols per Row for Databar GS1 Expanded Stacked. Value must be an even number between 4 and 20. (Everything higher than 8 results in barcodes that are too wide for most practical purposes)

Default: 4
 
Specific (ISBN)
Addon String Text for ISBN addon satellite barcode. Must be 5 digits or empty (= no addon).

Default: "90000"
 
Specific (PDF417)
RequestCols Int Per default (RequestCols = -1) the control will create a PDF417 symbol that is roughly 3:2 (width : height) as recommended by the ISO standard. Specify the desired number of columns (between 3 and 30) if you require a different size.

Default: -1
 
Specific (QR)
QrECC Int Per default the control creates a Quality M QR code (medium error correction capacity) as this gives the best compromise between size and ECC capability. Values permitted:
0 Quality M (recommended) 1 Quality L (least) 2 Quality H 3 Quality Q (best)

Default: 0
 

Methods

Name Parameter Comment
GetCode Float dpi Creates a barcode, returns a Bitmap with the code. The dpi parameter determines the output resolution, e.g. 300 for 300 dpi. The actual dimensions of the barcode (and, hence, the returned bitmap) are determined from the moduleHeight, moduleWidth and the encoded data.

Note: You must call this method before accessing the EPS property as it triggers creating the EPS. For resolution, provide 72. The returned bitmap can be ignored / discarded.

Returns: Bitmap
 
Init void Must be called before the first use of the control. Resets all properties to the defaults as described in this document.

Returns: void
 

More on DataToEncode
Data binding

The DataToEncode property of the control is data-bindable. To bind the property at design time, select the control and hit F4 to display the properties; scroll down to DataBindings and select a data source from the list or create a new data source. Of course it's also possible to data bind the property at runtime.


Back to the manual index.