Class PDF417Bean

java.lang.Object
org.krysalis.barcode4j.impl.AbstractBarcodeBean
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.7 2012-05-17 13:57:37 jmaerki Exp $
  • Field Details

    • 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:
    • DEFAULT_COLUMN_COUNT

      protected static final int DEFAULT_COLUMN_COUNT
      The default column count for PDF417.
      See Also:
    • DEFAULT_ERROR_CORRECTION_LEVEL

      protected static final int DEFAULT_ERROR_CORRECTION_LEVEL
      The default error correction level for PDF417
      See Also:
  • Constructor Details

    • PDF417Bean

      public PDF417Bean()
      Create a new instance.
  • Method Details

    • 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:
    • generateBarcode

      public void generateBarcode(CanvasProvider canvas, 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:
    • calcDimensions

      public BarcodeDimension calcDimensions(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:
    • getColumns

      public int getColumns()
      Returns:
      the number of data columns to produce
    • 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
    • getErrorCorrectionLevel

      public int getErrorCorrectionLevel()
      Returns:
      the error correction level (0-8)
    • 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)
    • getMaxCols

      public int getMaxCols()
      Gets the maxCols.
      Returns:
      Returns the maxCols.
    • setMaxCols

      public void setMaxCols(int maxCols)
      Sets the maximum number of columns.
      Parameters:
      maxCols - the maximum number of columns..
    • getMaxRows

      public int getMaxRows()
      Gets the maximum number of columns.
      Returns:
      Returns the maximum number of columns.
    • setMaxRows

      public void setMaxRows(int maxRows)
      Sets the maximum number of rows.
      Parameters:
      maxRows - the maximum number of rows.
    • getMinCols

      public int getMinCols()
      Gets the minimum number of columns.
      Returns:
      Returns the minimum number of columns.
    • setMinCols

      public void setMinCols(int minCols)
      Sets the minimum number of columns.
      Parameters:
      minCols - The minimum number of columns.
    • getMinRows

      public int getMinRows()
      Gets the minimum number of rows.
      Returns:
      Returns the minimum number of rows.
    • setMinRows

      public void setMinRows(int minRows)
      Sets the minimum of rows.
      Parameters:
      minRows - the minimum of rows to set.
    • getRowHeight

      public double getRowHeight()
      Returns the height of the rows.
      Returns:
      the row height (in mm)
    • setRowHeight

      public void setRowHeight(double height)
      Sets the height of the rows.
      Parameters:
      height - the height of the rows (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
    • 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
    • getEncoding

      public String getEncoding()
      Returns the message encoding.
      Returns:
      the message encoding (default is "ISO-8859-1")
    • setEncoding

      public void setEncoding(String encoding)
      Sets the message encoding. The value must conform to one of Java's encodings and have a mapping in the ECI registry.
      Parameters:
      encoding - the message encoding
    • isECIEnabled

      public boolean isECIEnabled()
      Indicates whether the generation of ECI sequences is enabled.
      Returns:
      true if generation of ECI sequences is enabled.
    • setECIEnabled

      public void setECIEnabled(boolean value)
      Controls whether ECI sequences are generated for the output encoding.
      Parameters:
      value - true to enable the generation of ECI sequences