Saves the barcode image to file
Example
BarCodeBuilder b = new BarCodeBuilder();
b.setSymbology(Symbology.CODE128);
b.setCodeText("1234566");
//save as bmp
b.save("C:\\test.bmp");
//save as jpg
b.save("c:\\test.jpg");
//save to current directory as png
b.save("test.png");
Saves the barcode image to file
Example
BarCodeBuilder b = new BarCodeBuilder();
b.setSymbology(Symbology.CODE128);
b.setCodeText("1234566");
//save as bmp
b.save("C:\\test.bmp", "bmp");
//save as jpg
b.save("c:\\test.jpg", "jpg");
//save to current directory as png
b.save("test.png", "png");
Saves the barcode image to file
Example
BarCodeBuilder b = new BarCodeBuilder();
b.setSymbology(Symbology.CODE128);
b.setCodeText("1234566");
//save as bmp
b.save(new File("C:\\test.bmp"), "bmp");
Sets the bar's height for 1D barcodes, measured in com.aspose.barcode.GraphicsUnit
Example
BarCodeBuilder b = new BarCodeBuilder();
b.setGraphicsUnit(GraphicsUnit.MILIMETER);
b.setBarHeight(20f);
Sets the caption below the barcode image
Example
BarCodeBuilder b = new BarCodeBuilder();
b.setCaptionBelow(new Caption("Caption below the barcode image"));
Sets code set for code128 types of barcode
Example
BarCodeBuilder b = new BarCodeBuilder();
b.setSymbology(Symbology.CODE128);
b.setCode128Set(Code128Set.AUTO);
Sets the measurement of graphics unit, default to millimeter
Example
BarCodeBuilder b = new BarCodeBuilder();
//graphics unit set to pixel
b.setGraphicsUnit(GraphicsUnit.PIXEL);
//the smallest bar's width will be 2 pixel
b.setXDimension(2);
//bar's height of one dimensional barcode will be 20 pixels
b.setBarHeight(20);
Sets the image quality of the barcode image, it's not recommended to use the
anti alias setting, that will make the barcode image harder to read by machine
Example
BarCodeBuilder b = new BarCodeBuilder();
b.setImageQuality(ImageQuality.ANTI_ALIAS);
Sets compaction mode of PDF417 barcode, available modes are PDF417CompactMode.AUTO, PDF417CompactMode.BINARY, PDF417CompactMode.NUMERIC, PDF417CompactMode.TEXT
Sets the rotation angle of the barcode image, default to 0 degree, if rotation
angle not not equal to 0, 90, 180 or 270, the barcode maybe jagged, setImageQuality
to anti-alias to solve this problem
Example
setScanStep(int) -
Method in class com.aspose.barcode.BarCodeReader
Sets the width of x smallest bar, or the smallest module's width of 2D barcodes
measured in GraphicsUnit
Example
BarCodeBuilder b = new BarCodeBuilder();
b.setGraphicsUnit(GraphicsUnit.MILIMETER);
b.setXDimension(0.5f);