use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class SpecifySymbology method main.
public static void main(String[] args) {
// The path to the resource directory.
String dataDir = Utils.getDataDir(SpecifySymbology.class) + "Barcode/BasicFeatures/";
// Generate and save the image to file
BarCodeBuilder builder = new BarCodeBuilder();
// Set code text
builder.setCodeText("test-123");
// Set Symbology type
builder.setEncodeType(com.aspose.barcode.EncodeTypes.CODE_39_STANDARD);
builder.save(dataDir + "Code39Standard.jpg");
}
use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class CreatingTwoDimensional2DBarcode method creatingADataMatrixBarcode.
public static void creatingADataMatrixBarcode(String dataDir) {
BarCodeBuilder b = new BarCodeBuilder();
b.setEncodeType(com.aspose.barcode.EncodeTypes.DATA_MATRIX);
// Width of each module
b.setxDimension(0.6f);
b.setCodeText("123456789");
b.save(dataDir + "datamatrix.bmp");
}
use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class GenerateMultipleMacroPdf417 method main.
public static void main(String[] args) {
String dataDir = Utils.getDataDir(GenerateMultipleMacroPdf417.class) + "2DBarcode/UtilityFeatures/";
BarCodeBuilder builder = new BarCodeBuilder();
builder.setEncodeType(com.aspose.barcode.EncodeTypes.MACRO_PDF_417);
// Create array for storing multiple barcodes
int nSize = 4;
String[] lstCodeText = new String[] { "code-1", "code-2", "code-3", "code-last" };
String strFileID = "1";
// Check the listbox for getting codetext and generating the barcodes
for (int nCount = 1; nCount <= nSize; nCount++) {
builder.setCodeText(lstCodeText[nCount - 1]);
// fileID should be same for all the generated barcodes
builder.setMacroPdf417FileID(Integer.parseInt(strFileID));
// Assign segmentID in increasing order (1,2,3,....)
builder.setMacroPdf417SegmentID(nCount);
// Save the barcode (fileid_segmentid.png)
builder.save(dataDir + strFileID + "_" + nCount + ".png");
}
}
use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class HidingCodeTextThatIsTooLongToDisplay method reduceTheCodeTextFontSize.
public static void reduceTheCodeTextFontSize(String dataDir) throws IOException {
BarCodeBuilder b = new BarCodeBuilder();
b.setEncodeType(com.aspose.barcode.EncodeTypes.DATA_MATRIX);
b.setCodeText("The quick brown fox jumps over the lazy dog\n The quick brown fox jumps over the lazy dog\n");
b.setCodeLocation(CodeLocation.None);
b.setCodeTextFont(new Font("Serif", Font.BOLD + Font.ITALIC, 20));
b.save(dataDir + "reduceFontSize.bmp", BarCodeImageFormat.Bmp);
}
use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class BarcodeWithSegments method main.
public static void main(String[] args) {
// Instantiate BarCodeBuilder object
com.aspose.barcode.BarCodeBuilder builder = new com.aspose.barcode.BarCodeBuilder();
// Set the Code text for the barcode
builder.setCodeText("(01)98898765432106(3202)012345(15)991231");
// Set the symbology type to Code128
builder.setEncodeType(com.aspose.barcode.EncodeTypes.DATABAR_EXPANDED_STACKED);
// Set the cloumn property to define segments per row
builder.setColumns(6);
// Save the image
builder.save("6segmets.png");
}
Aggregations