public class BarcodeQRCode extends Object
Constructor and Description |
---|
BarcodeQRCode(String content, int width, int height, Map<EncodeHintType,Object> hints)
Creates the QR barcode.
|
Modifier and Type | Method and Description |
---|---|
Image |
createAwtImage(Color foreground, Color background)
Creates a java.awt.Image .
|
Rectangle |
getBarcodeSize()
Gets the size of the barcode grid.
|
Image |
getImage()
Gets an Image with the barcode.
|
void |
placeBarcode(PdfContentByte cb, BaseColor foreground, float moduleSide) |
public BarcodeQRCode(String content, int width, int height, Map<EncodeHintType,Object> hints)
content
- the text to be encoded
width
- the barcode width
height
- the barcode height
hints
- modifiers to change the way the barcode is create. They can be EncodeHintType.ERROR_CORRECTION and EncodeHintType.CHARACTER_SET. For EncodeHintType.ERROR_CORRECTION the values can be ErrorCorrectionLevel.L, M, Q, H. For EncodeHintType.CHARACTER_SET the values are strings and can be Cp437, Shift_JIS and ISO-8859-1 to ISO-8859-16. You can also use UTF-8, but correct behaviour is not guaranteed as Unicode is not supported in QRCodes. The default value is ISO-8859-1.
WriterException
public Image getImage() throws BadElementException
Image
with the barcode.
Image
BadElementException
- on error
public Image createAwtImage(Color foreground, Color background)
java.awt.Image
.
foreground
- the color of the bars
background
- the color of the background
public void placeBarcode(PdfContentByte cb, BaseColor foreground, float moduleSide)
public Rectangle getBarcodeSize()
Copyright © 1998–2024. All rights reserved.