barcode4j 2.1.0

org.krysalis.barcode4j.impl.pdf417
Class PDF417Bean

java.lang.Object
  extended by org.krysalis.barcode4j.impl.AbstractBarcodeBean
      extended by org.krysalis.barcode4j.impl.pdf417.PDF417Bean
All Implemented Interfaces:
BarcodeGenerator

public class PDF417Bean
extends AbstractBarcodeBean

This class is an implementation of the PDF417 barcode.

Version:
$Id: PDF417Bean.java,v 1.6 2008/05/13 13:00:43 jmaerki Exp $

Field Summary
protected static int DEFAULT_COLUMN_COUNT
          The default column count for PDF417.
protected static int DEFAULT_ERROR_CORRECTION_LEVEL
          The default error correction level for PDF417
protected static double DEFAULT_MODULE_WIDTH
          The default module width for PDF417.
protected static int DEFAULT_X_TO_Y_FACTOR
          The default wide factor for PDF417.
 
Fields inherited from class org.krysalis.barcode4j.impl.AbstractBarcodeBean
doQuietZone, fontName, fontSize, height, moduleWidth, msgPos, pattern, quietZone, quietZoneVertical
 
Constructor Summary
PDF417Bean()
          Create a new instance.
 
Method Summary
 BarcodeDimension calcDimensions(java.lang.String msg)
          Calculates the dimension of a barcode with the given message.
 void generateBarcode(CanvasProvider canvas, java.lang.String msg)
          Generates a barcode using the given Canvas to render the barcode to its output format.
 double getBarWidth(int width)
          Returns the effective width of a bar with a given logical width.
 int getColumns()
           
 int getErrorCorrectionLevel()
           
 int getMaxCols()
          Gets the maxCols.
 int getMaxRows()
          Gets the maximum number of columns.
 int getMinCols()
          Gets the minimum number of columns.
 int getMinRows()
          Gets the minimum number of rows.
 double getRowHeight()
          Returns the height of the rows.
 double getWidthToHeightRatio()
          Gets the ratio of the barcode width to the height.
 void setColumns(int cols)
          Sets the number of data columns for the barcode.
 void setErrorCorrectionLevel(int level)
          Sets the error correction level for the barcode.
 void setMaxCols(int maxCols)
          Sets the maximum number of columns.
 void setMaxRows(int maxRows)
          Sets the maximum number of rows.
 void setMinCols(int minCols)
          Sets the minimum number of columns.
 void setMinRows(int minRows)
          Sets the minimum of rows.
 void setRowHeight(double height)
          Sets the height of the rows.
 void setWidthToHeightRatio(double widthToHeightRatio)
          Sets the ratio of the barcode width to the height.
 
Methods inherited from class org.krysalis.barcode4j.impl.AbstractBarcodeBean
doQuietZone, getBarHeight, getFontName, getFontSize, getHeight, getHumanReadableHeight, getModuleWidth, getMsgPosition, getPattern, getQuietZone, getVerticalQuietZone, hasFontDescender, hasQuietZone, setBarHeight, setFontName, setFontSize, setHeight, setModuleWidth, setMsgPosition, setPattern, setQuietZone, setVerticalQuietZone
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MODULE_WIDTH

protected static final double DEFAULT_MODULE_WIDTH
The default module width for PDF417.


DEFAULT_X_TO_Y_FACTOR

protected static final int DEFAULT_X_TO_Y_FACTOR
The default wide factor for PDF417.

See Also:
Constant Field Values

DEFAULT_COLUMN_COUNT

protected static final int DEFAULT_COLUMN_COUNT
The default column count for PDF417.

See Also:
Constant Field Values

DEFAULT_ERROR_CORRECTION_LEVEL

protected static final int DEFAULT_ERROR_CORRECTION_LEVEL
The default error correction level for PDF417

See Also:
Constant Field Values
Constructor Detail

PDF417Bean

public PDF417Bean()
Create a new instance.

Method Detail

generateBarcode

public void generateBarcode(CanvasProvider canvas,
                            java.lang.String msg)
Description copied from class: AbstractBarcodeBean
Generates a barcode using the given Canvas to render the barcode to its output format.

Specified by:
generateBarcode in interface BarcodeGenerator
Specified by:
generateBarcode in class AbstractBarcodeBean
Parameters:
canvas - CanvasProvider that the barcode is to be rendered on.
msg - message to encode
See Also:
BarcodeGenerator.generateBarcode(CanvasProvider, String)

calcDimensions

public BarcodeDimension calcDimensions(java.lang.String msg)
Description copied from class: AbstractBarcodeBean
Calculates the dimension of a barcode with the given message. The dimensions are dependant on the configuration of the barcode generator.

Specified by:
calcDimensions in interface BarcodeGenerator
Overrides:
calcDimensions in class AbstractBarcodeBean
Parameters:
msg - message to use for calculation.
Returns:
BarcodeDimension a BarcodeDimension object containing the barcode's dimensions
See Also:
BarcodeGenerator.calcDimensions(String)

getBarWidth

public double getBarWidth(int width)
Description copied from class: AbstractBarcodeBean
Returns the effective width of a bar with a given logical width.

Specified by:
getBarWidth in class AbstractBarcodeBean
Parameters:
width - the logical width (1=narrow, 2=wide)
Returns:
the effective width of a bar (in mm)
See Also:
AbstractBarcodeBean.getBarWidth(int)

getColumns

public int getColumns()
Returns:
the number of data columns to produce

getErrorCorrectionLevel

public int getErrorCorrectionLevel()
Returns:
the error correction level (0-8)

getMaxCols

public int getMaxCols()
Gets the maxCols.

Returns:
Returns the maxCols.

getMaxRows

public int getMaxRows()
Gets the maximum number of columns.

Returns:
Returns the maximum number of columns.

getMinCols

public int getMinCols()
Gets the minimum number of columns.

Returns:
Returns the minimum number of columns.

getMinRows

public int getMinRows()
Gets the minimum number of rows.

Returns:
Returns the minimum number of rows.

getRowHeight

public double getRowHeight()
Returns the height of the rows.

Returns:
the row height (in mm)

getWidthToHeightRatio

public double getWidthToHeightRatio()
Gets the ratio of the barcode width to the height. e.g. a ratio of 5 means the width is 5 times the height

Returns:
Returns the ratio of the barcode width to the height

setColumns

public void setColumns(int cols)
Sets the number of data columns for the barcode. The number of rows will automatically be determined based on the amount of data.

Parameters:
cols - the number of columns

setErrorCorrectionLevel

public void setErrorCorrectionLevel(int level)
Sets the error correction level for the barcode.

Parameters:
level - the error correction level (a value between 0 and 8)

setMaxCols

public void setMaxCols(int maxCols)
Sets the maximum number of columns.

Parameters:
maxCols - the maximum number of columns..

setMaxRows

public void setMaxRows(int maxRows)
Sets the maximum number of rows.

Parameters:
maxRows - the maximum number of rows.

setMinCols

public void setMinCols(int minCols)
Sets the minimum number of columns.

Parameters:
minCols - The minimum number of columns.

setMinRows

public void setMinRows(int minRows)
Sets the minimum of rows.

Parameters:
minRows - the minimum of rows to set.

setRowHeight

public void setRowHeight(double height)
Sets the height of the rows.

Parameters:
height - the height of the rows (in mm)

setWidthToHeightRatio

public void setWidthToHeightRatio(double widthToHeightRatio)
Sets the ratio of the barcode width to the height. e.g. a ratio of 5 means the width is 5 times the height

Parameters:
widthToHeightRatio - the ratio of the barcode width to the height

barcode4j 2.1.0

Copyright © 2000-2010 Jeremias Maerki. All rights reserved.