use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class ManageXAndYDimension method setYDimension.
public static void setYDimension() {
// The path to the resource directory.
String dataDir = Utils.getDataDir(ManageXAndYDimension.class) + "Barcode/AdvancedFeatures/";
BarCodeBuilder bb = new BarCodeBuilder();
bb.setCodeText("12345678");
bb.setEncodeType(com.aspose.barcode.EncodeTypes.PDF_417);
// Set the Y-Dimension for the bars of the barcode
bb.setyDimension(4);
// Save the Barcode image to file
bb.save(dataDir + "yDimention.jpg");
}
use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class SetBarsHeight method main.
public static void main(String[] args) {
// The path to the resource directory.
String dataDir = Utils.getDataDir(SetBarsHeight.class) + "Barcode/AdvancedFeatures/";
// Instantiate barcode object
BarCodeBuilder bb = new BarCodeBuilder();
bb.setCodeText("12345678");
bb.setEncodeType(com.aspose.barcode.EncodeTypes.CODE_128);
// Set the bar height to be 3 milimeter
bb.setBarHeight(3.0f);
// Save the Barcode image to file
bb.save(dataDir + "barsHeight.jpg");
}
use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class SetStartAndStopSymbols method main.
public static void main(String[] args) {
// The path to the resource directory.
String dataDir = Utils.getDataDir(SetStartAndStopSymbols.class) + "Barcode/AdvancedFeatures/";
// Create instance of BarCodeBuilder, specify codetext and symbology in the constructor
BarCodeBuilder builder = new BarCodeBuilder("12345678", com.aspose.barcode.EncodeTypes.CODABAR);
// Set the codabar start symbol to A
builder.setCodabarStartSymbol(CodabarSymbol.A);
// Set the codabar stop symbol to D
builder.setCodabarStopSymbol(CodabarSymbol.D);
// Save the image to disk in PNG format
builder.save(dataDir + "startAndStopSymbols.png");
}
use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class SupplementData method main.
public static void main(String[] args) {
// The path to the resource directory.
String dataDir = Utils.getDataDir(SupplementData.class) + "Barcode/AdvancedFeatures/";
BarCodeBuilder bb = new BarCodeBuilder();
bb.setCodeText("123456789123");
bb.setEncodeType(com.aspose.barcode.EncodeTypes.EAN_13);
// Set the supplement data (5 Digit)
bb.setSupplementData("12345");
// Set space between the supplemental barcode and main barcode
bb.setSupplementSpace(2.0f);
// Save the Barcode image to file
bb.save(dataDir + "supplementData.jpg");
}
use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class BarcodeCaption method main.
public static void main(String[] args) {
// The path to the resource directory.
String dataDir = Utils.getDataDir(BarcodeCaption.class) + "Barcode/BasicFeatures/";
// Instantiate Barcode object
BarCodeBuilder bb = new BarCodeBuilder();
// Set the code text of the barcode
bb.setCodeText("1234567");
// Set the symbology type to code128
bb.setEncodeType(com.aspose.barcode.EncodeTypes.CODE_128);
Caption caption = new Caption();
caption.setText("Caption");
caption.setTextAlign(com.aspose.barcode.StringAlignment.Center);
bb.setCaptionAbove(caption);
bb.setCaptionBelow(caption);
bb.getCaptionAbove().setTextAlign(com.aspose.barcode.StringAlignment.Near);
bb.getCaptionAbove().setText("Aspose.Demo");
bb.getCaptionAbove().setVisible(true);
bb.getCaptionAbove().setFont(new java.awt.Font("Pristina", Font.PLAIN, 14));
bb.getCaptionAbove().setForeColor(java.awt.Color.RED);
bb.getCaptionBelow().setTextAlign(com.aspose.barcode.StringAlignment.Far);
bb.getCaptionBelow().setText("Aspose.Demo");
bb.getCaptionBelow().setVisible(true);
bb.getCaptionBelow().setFont(new java.awt.Font("Pristina", Font.PLAIN, 14));
bb.getCaptionBelow().setForeColor(java.awt.Color.RED);
// Save the Barcode image to file
bb.save(dataDir + "barcodeCaption.jpg");
}
Aggregations