BarcodeDataMatrix extends Barcode2D { @Override public Rectangle placeBarcode(PdfCanvas canvas, Color foreground) { return placeBarcode(canvas, foreground, DEFAULT_MODULE_SIZE); } BarcodeDataMatrix();  BarcodeDataMatrix(String code);  BarcodeDataMatrix(String code, String encoding); @Override Rectangle getBarcodeSize(); @Override Rectangle placeBarcode(PdfCanvas canvas, Color foreground); @Override PdfFormXObject createFormXObject(Color foreground, PdfDocument document); PdfFormXObject createFormXObject(Color foreground, float moduleSide, PdfDocument document); Rectangle placeBarcode(PdfCanvas canvas, Color foreground, float moduleSide); java.awt.Image createAwtImage(java.awt.Color foreground, java.awt.Color background); Rectangle getBarcodeSize(float moduleHeight, float moduleWidth); int setCode(String text); int setCode(byte[] text, int textOffset, int textSize); int getHeight(); void setHeight(int height); int getWidth(); void setWidth(int width); int getWs(); void setWs(int ws); int getOptions(); void setOptions(int options); void setEncoding(String encoding); String getEncoding(); static final int DM_NO_ERROR; static final int DM_ERROR_TEXT_TOO_BIG; static final int DM_ERROR_INVALID_SQUARE; static final int DM_ERROR_EXTENSION; static final int DM_AUTO; static final int DM_ASCII; static final int DM_C40; static final int DM_TEXT; static final int DM_B256; static final int DM_X12; static final int DM_EDIFACT; static final int DM_RAW; static final int DM_EXTENSION; static final int DM_TEST; static final String DEFAULT_DATA_MATRIX_ENCODING; }
@Test public void barcode02Test() throws IOException, PdfException, InterruptedException { String filename = "barcodeDataMatrix2.pdf"; PdfWriter writer = new PdfWriter(destinationFolder + filename); PdfDocument document = new PdfDocument(writer); PdfPage page1 = document.addNewPage(); PdfCanvas canvas = new PdfCanvas(page1); BarcodeDataMatrix barcode2 = new BarcodeDataMatrix("дима", "UTF-8"); barcode2.placeBarcode(canvas, ColorConstants.GREEN, 10); document.close(); Assert.assertNull(new CompareTool().compareByContent(destinationFolder + filename, sourceFolder + "cmp_" + filename, destinationFolder, "diff_")); }