I am referencing this to generate code39 format 1D barcode using Zxing library.
Generate barcode image in Android application
I can generate the barcode. Because i will have three different codes to show in the UI. Three different codes can have different length like below:
String barcode1_data = "1234567EA";
String barcode2_data = "1234567891012388";
String barcode3_data = "123456789000100";
bitmap1 = encodeAsBitmap2(barcode1_data, BarcodeFormat.CODE_39, 800, 120);
bitmap2 = encodeAsBitmap2(barcode2_data, BarcodeFormat.CODE_39, 1200, 150);
bitmap3 = encodeAsBitmap2(barcode3_data, BarcodeFormat.CODE_39, 1200, 150);
I would like to have the three different barcodes to have the same height, and also the width depends on the characters. In my sample code, i hard coded, but i want it to be dynamic. Is there any rule to calculate the height and width?