Package com.itextpdf.barcodes
Class Barcode2D
java.lang.Object
com.itextpdf.barcodes.Barcode2D
- Direct Known Subclasses:
-
BarcodeDataMatrix
,BarcodePDF417
,BarcodeQRCode
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract PdfFormXObject
createFormXObject
(Color foreground, PdfDocument document) Creates a PdfFormXObject with the barcode.createFormXObject
(PdfDocument document) Creates a PdfFormXObject with the barcode.abstract Rectangle
Gets the maximum area that the barcode and the text, if any, will occupy.abstract Rectangle
placeBarcode
(PdfCanvas canvas, Color foreground) Places the barcode in aPdfCanvas
.
-
Field Details
-
DEFAULT_MODULE_SIZE
protected static final float DEFAULT_MODULE_SIZE- See Also:
-
-
Constructor Details
-
Barcode2D
public Barcode2D()
-
-
Method Details
-
getBarcodeSize
Gets the maximum area that the barcode and the text, if any, will occupy. The lower left corner is always (0, 0).- Returns:
- the size the barcode occupies.
-
placeBarcode
Places the barcode in aPdfCanvas
. The barcode is always placed at coordinates (0, 0). Use the translation matrix to move it elsewhere.- Parameters:
-
canvas
- thePdfCanvas
where the barcode will be placed -
foreground
- the foreground color. It can benull
- Returns:
- the dimensions the barcode occupies
-
createFormXObject
Creates a PdfFormXObject with the barcode. Default foreground color will be used.- Parameters:
-
document
- The document - Returns:
- the XObject.
-
createFormXObject
Creates a PdfFormXObject with the barcode.- Parameters:
-
foreground
- The color of the pixels. It can benull
-
document
- The document - Returns:
- the XObject.
-