com.google.zxing.oned
Class EAN8Writer
java.lang.Object
com.google.zxing.oned.OneDimensionalCodeWriter
com.google.zxing.oned.UPCEANWriter
com.google.zxing.oned.EAN8Writer
- All Implemented Interfaces:
- Writer
public final class EAN8Writer
- extends UPCEANWriter
This object renders an EAN8 code as a BitMatrix
.
- Author:
- [email protected] (Ari Pollak)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EAN8Writer
public EAN8Writer()
encode
public BitMatrix encode(String contents,
BarcodeFormat format,
int width,
int height,
Map<EncodeHintType,?> hints)
throws WriterException
- Description copied from class:
OneDimensionalCodeWriter
- Encode the contents following specified format.
width
and height
are required size. This method may return bigger size
BitMatrix
when specified size is too small. The user can set both width
and
height
to zero to get minimum size barcode. If negative value is set to width
or height
, IllegalArgumentException
is thrown.
- Specified by:
encode
in interface Writer
- Overrides:
encode
in class OneDimensionalCodeWriter
- 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
- Throws:
WriterException
encode
public byte[] encode(String contents)
- Description copied from class:
OneDimensionalCodeWriter
- Encode the contents to byte 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:
encode
in class OneDimensionalCodeWriter
- Returns:
- a byte array of horizontal pixels (0 = white, 1 = black)
Copyright © 2007-2012. All Rights Reserved.