Linear BarCode class properties

Properties

Class Attribute JavaBean Applet & Servlet Default Value Comments
autoSize AutoSize see comments True If true, the size the barcode image will automatically be determined. If this is set to false, the size will need to be specified with setSize(w,h). When using the applet or servlet, autoSize will automatically be set to false if the HEIGHT and WIDTH are manually specified. Because a temp image is created to determine the size, performance is improved by specifying the size and setting autoSize to false.
barType SymbologyID CODE_TYPE CODE128
(13)
This is the type of barcode to create. Valid values for the barcode types are as follows: CODE39=0; CODE39EXT=1; INTERLEAVED25=2; CODE11=3; CODABAR=4; MSI=5; UPCA=6; IND25=7; MAT25=8; CODE93=9; EAN13=10; EAN8=11; UPCE=12; CODE128=13; CODE93EXT=14; POSTNET=15; PLANET=16; UCC128=17; ONECODE=18; the default is CODE128. Use the number value for the JavaBean and the text value for the applet and servlet. For example, the servlet query string would include: &CODE_TYPE=ONECODE
backColor Background BACK_COLOR WHITE The background color of the barcode. It is recommended to use the default setting of WHITE. Valid values are: RED, BLUE, GREEN, BLACK, GRAY, LIGHTGRAY, WHITE, DARKGRAY, YELLOW, ORANGE, CYAN and MAGENTA. The RGB numerical value of a color can also be used as a parameter (e.g. 0x00FF00 for green).
barColor Foreground BAR_COLOR BLACK The color of the bars. It is recommended to use the default setting of BLACK. Valid values are: RED, BLUE, GREEN, BLACK, GRAY, LIGHTGRAY, WHITE, DARKGRAY, YELLOW, ORANGE, CYAN and MAGENTA. The RGB numerical value of a color can also be used as a parameter (e.g. 0x00FF00 if green).
barHeightCM BarHeightCM BAR_HEIGHT 1 The height of the bars in CM, which also adjusts the entire height of the barcode.
bearerBarHori bearerBarHorizontal BEARERBAR_HORIZONTAL 0 The size of the horizontal bearer bars. Valid values are 0-10 which are a multiple of X.
bearerBarVert bearerBarVertical BEARERBAR_VERTICAL 0 The size of the vertical bearer bars. Valid values are 0-10 which are a multiple of X.
characterGrouping characterGrouping CHARACTER_GROUPING 0 The number of digits which will be grouped together in the human readable text. Valid values are 0,3,4, and 5.
CODABARStartChar CODABARStartChar CODABAR_START A Start character for CODABAR. Valid values are "A", "B", "C" or "D".
CODABARStopChar CODABARStopChar CODABAR_STOP B Stop character for CODABAR. Valid values are "A", "B", "C" or "D".
code DataToEncode BARCODE na This is the data text to be encoded in the barcode. The input is a string value type. A byte array may also be use in PDF417 or DataMatrix.
code128set Code128Set CODE128_SET 0 The set of characters to be used in Code 128. Valid values are: 0, A, B or C. 0 is used for the automatic selection. It is recommended to leave this at the default setting.
checkCharacter CheckCharacter CHECK_CHAR Y If true, the software will calculate the check character automatically. The applet and servlet convert "Y" to true and "N" to false.
fontColor TextFontColor FONT_COLOR BLACK The color of the text below the barcode. Valid values are: RED, BLUE, GREEN, BLACK, GRAY, LIGHTGRAY, WHITE, DARKGRAY, YELLOW, ORANGE, CYAN and MAGENTA. The RGB numerical value of a color can also be used as a parameter (e.g. 0x00FF00 if green).
barCodeEncoder format (see example) (see example) FORMAT JPEG Determines the format of the image when using the servlet or saving a barcode image to a file. Valid values are GIF and JPEG. The GIF files generated are typically 4 to 20 times smaller in size than the JPEG files.
leftMarginCM LeftMarginCM LEFT_MARGIN .3 The left margin in CM. This may need to be increased for UPC and EAN barcode types.
N NarrowToWideRatio N 2 The wide to narrow ratio. A value of 2 (the default), means that wide bars will be 2 times the width of narrow bars. This setting is only valid for barcode types that support an N dimension such as Code 39 and ITF.
resolution PixelsPerCM na 38 The resolution used to create the X dimension and other measurements in pixels; Default is 38 Pixels Per CM which is about 96 DPI. 96 DPI is the resolution of the web browser; this setting works best when using the servlet or when creating images for the web browser.
rotate RotationAngle ROTATE 0 Indicates the angle of the barcode. Valid values are 0 (normal), 90 (vertical), 180 (inverted) and 270 (inverted vertical).
setFont Font TEXT_FONT Arial The font used to display the human readable code. To change the font in the class library, use the following syntax:
  Font newFont = new Font("Arial",Font.PLAIN,30);
  bc.setFont(newFont);
and to change the font in the applet or servlet, use this syntax:
 &TEXT_FONT=ARIAL|BOLD|12
setSize Size WIDTH, HEIGHT Null Sets the size in pixels of the barcode image. If the size is set manually, autoSize must be turned off. When using the applet and servlet, autoSize is automatically set to false if the HEIGHT and WIDTH are manually specified.
setProcessTilde ProcessTilde PT TRUE If true (or "Y" when using the applet or servlet) the tilde (~) will be processed. The default is True.
showText ShowText ST Y If this value is true, the human readable text will be displayed with the barcode. The applet and servlet convert "Y" to true and "N" to false.
textMarginCM TextMarginCM TEXT_MARGIN 0.3 The amount of space between the barcode and the human readable text.
topMarginCM TopMarginCM TOP_MARGIN .2 The top margin of the barcode (also know as the quiet zone).
UPCESystem UPCESystem UPCE_SYSTEM 0 The encoding system to be used for UPC-E compression, valid values are 0 and 1. The default is 0.
whiteBarIncrease whiteBarIncrease WHITEBAR_INCREASE 0 The percentage of the XDimension to increase the white bars. Valid options are 0-99.
X XDimensionCM X .03 This setting adjusts the width in centimeters of narrow bars, which also adjusts the entire width of the barcode.