public final class QRCodeWriter extends Object implements Writer
Encodes text content into a QR Code barcode using the ZXing library's encoder, supporting various error correction levels and encoding hint types.
| Constructor and Description |
|---|
QRCodeWriter() |
| Modifier and Type | Method and Description |
|---|---|
BitMatrix | encode(String contents,
BarcodeFormat format,
int width,
int height)Encode a barcode using the default settings. |
BitMatrix | encode(String contents,
BarcodeFormat format,
int width,
int height,
Map<EncodeHintType,?> hints)Encode a barcode using the specified settings and optional hints. |
public BitMatrix encode(String contents, BarcodeFormat format, int width, int height) throws WriterException
Writerencode in interface Writercontents - The contents to encode in the barcodeformat - The barcode format to generatewidth - The preferred width in pixelsheight - The preferred height in pixelsBitMatrix representing encoded barcode imageWriterException - if contents cannot be encoded legally in a formatpublic BitMatrix encode(String contents, BarcodeFormat format, int width, int height, Map<EncodeHintType,?> hints) throws WriterException
Writerencode in interface Writercontents - 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 encoderBitMatrix representing encoded barcode imageWriterException - if contents cannot be encoded legally in a format