Package com.google.zxing.oned
Class Code128Writer
- java.lang.Object
-
- com.google.zxing.oned.OneDimensionalCodeWriter
-
- com.google.zxing.oned.Code128Writer
-
- All Implemented Interfaces:
Writer
public final class Code128Writer extends OneDimensionalCodeWriter
This object renders a CODE128 code as aBitMatrix.
-
-
Constructor Summary
Constructors Constructor Description Code128Writer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean[]encode(java.lang.String contents)Encode the contents to boolean array expression of one-dimensional barcode.BitMatrixencode(java.lang.String contents, BarcodeFormat format, int width, int height, java.util.Map<EncodeHintType,?> hints)Encode the contents following specified format.-
Methods inherited from class com.google.zxing.oned.OneDimensionalCodeWriter
appendPattern, encode, getDefaultMargin
-
-
-
-
Method Detail
-
encode
public BitMatrix encode(java.lang.String contents, BarcodeFormat format, int width, int height, java.util.Map<EncodeHintType,?> hints) throws WriterException
Description copied from class:OneDimensionalCodeWriterEncode the contents following specified format.widthandheightare required size. This method may return bigger sizeBitMatrixwhen specified size is too small. The user can set bothwidthandheightto zero to get minimum size barcode. If negative value is set towidthorheight,IllegalArgumentExceptionis thrown.- Specified by:
encodein interfaceWriter- Overrides:
encodein classOneDimensionalCodeWriter- Parameters:
contents- The contents to encode in the barcodeformat- The barcode format to generatewidth- The preferred width in pixelsheight- The preferred height in pixelshints- Additional parameters to supply to the encoder- Returns:
BitMatrixrepresenting encoded barcode image- Throws:
WriterException- if contents cannot be encoded legally in a format
-
encode
public boolean[] encode(java.lang.String contents)
Description copied from class:OneDimensionalCodeWriterEncode the contents to boolean array expression of one-dimensional barcode. Start code and end code should be included in result, and side margins should not be included.- Specified by:
encodein classOneDimensionalCodeWriter- Parameters:
contents- barcode contents to encode- Returns:
- a
boolean[]of horizontal pixels (false = white, true = black)
-
-