KA.Barcode for Java
Guide for Resizing Data Matrix Barcodes in Java
Complete Java source code to generate, print Data Matrix images and change barcode size with Java Control
Data Matrix Barcode Generator for Java Overview
  • Easy to Integrate Data Matrix Generator other properties in your Java applications
  • Mature & Reliable Java Data Matrix generation library with latest barcode symbology ISO Standards
  • Easy to set bar module width(X), bar height(Y), image width and image height with Java Data Matrix
  • Royalty free with the purchase or Java Data Matrix generator developer license
  • Check sum digit of Data Matrix image can be automatically computed
  • Applet allows Data Matrix easily integrated into web pages
  • leftMargin, rightMargin, topMargin and bottomMargin are available to be adjusted to meet your need.
  • Unit of Measure can change the generated Data Matrix image in Inch, CM or Pixel
  • Java Data Matrix generation component supports rotating Data Matrix image with 0, 90, 180, 270 angles
Other Data Matrix Java Generation Setting Guide
Data Matrix, is also named as ECC200, 2D DataMatrix Barcode. Except Java Data Matrix Size Setting, KeepAutomation provides other concerned Data Matrix generation setting options to adjust the image and encoding data:
Java Data Matrix Size Setting Properties

Data Matrix Format Mode for Java Data Matrix size

The quantity of modules in a Data Matrix is determined by Property Data Matrix Format Mode (Default is DataMatrix.FORMAT_10X10) which varies from 10x10 to 144x144. Specify the Data Matrix Format to use on that symbology. Valid values see class DataMatrix.FORMAT_*x*; For example, Data Matrix with "F_12X12" format mode has 12 modules in X dimension, and 12 modules in Y dimension.
Other Data Matrix size setting properties
he size of Data Matrix generated in Java can be adjusted with the following properties:
  • moduleSize - Data Matrix module width of barcode module, default is 3 pixel
  • UOM - Unit of measure for all size related properties. UOM_PIXEL (0); UOM_CM (1); UOM_INCH (2). Default is UOM_PIXEL (0)
  • leftMargin - the space between the left side and bars in Data Matrix generated by Java Data Matrix
  • rightMargin - the space between the right side and bars in Data Matrix generated by Java Data Matrix, default is 0
  • topMargin - the space between the top side and bars, default is 0
  • bottomMargin - the space between the bottom side and bars, default is 0
  • barcodeWidth - the fixed width value of Data Matrix image, default is 0
  • barcodeHeight - the fixed height value of Data Matrix image, default is 0
  • textFont - the text font style of the generated Data Matrix, default is new Font("Arial", Font.PLAIN, 11)
  • autoResize - adjust the size with your setting properties with set it to be ture
Data Matrix Size Setting in Java - FAQ

How to Set a fixed Module Szie in Java Data Matrix Generation

In java applications, Data Matrix bar width can be set with the property - moduleSize. To set a fixed moduleSize, the Data Matrix image will be printed with the minimum module size.
  • Set the minimum value of moduleSize. For example, barcode.set moduleSize (4);
  • Set the autoResize to be false. For example, barcode.setautoReisize(false);
  • Adjust other option with your need

Create Data Matrix image with a fixed Image Width in Java

In java applications, Data Matrix image width can be set with the property - BarCodeWidth. To set a fixed image width, the Data Matrix image will be drawn with the fixed image width.
  • Set the fixed value of BarCodeWidth. For example, barcode.setBarCodeWidth (180);
  • Set the autoResize to be true. For example, barcode.setautoReisize(true);
  • Adjust other option with your need

Draw Data Matrix image with a Minimum moduleSize and BarCodeWidth in Java

In java applications, Data Matrix image size can be changed with moduleSize and BarCodeWidth at the same time.
  • Set the minimum value of X. For example, barcode.set moduleSize (4);
  • Set the fixed value of BarCodeWidth. For example, barcode.setBarCodeWidth (200);
  • Set the autoResize to be false. For example, barcode.setautoReisize(false);
  • Adjust other option with your need
Note that, once setting a fixed X, a minimum BarCodeWidth Data Matrix image is automatically created in Java. If your set BarCodeWidth is smaller than the minimum value, the generated Data Matrix image width will be the minimum barcode width value in java. If your set BarCodeWidth is larger than the minimum value, the generated Data Matrix image width will be the set barcode width value in java. This situation is the same as BarCodeHeight.