Rows and Columns for the GS1- DATABAR_EXPANDED_STACKED

Hi ,

Can you please help me to understand of how the row/column works for the DATABAR_EXPANDED_STACKED.

I like to set the 7 rows for the barcode (String GTIN1 = “(01)00766907146318(17)180902(10)12347891012(17)991210(13)991211(11)991011(21)9990023295”;). but it only allow me to set the max rows is 6 with x-dim is 0.254f.

I want to know what is other parameter impact the row. for exampe: default column, encode data. also what is the segment for the databar barcode. thanks you very much.

String GTIN1 = “(01)00766907146318(17)180902(10)12347891012(17)991210(13)991211(11)991011(21)9990023295”;

	// Generate and save the image to file
	BarCodeBuilder builder = new BarCodeBuilder();
	// Set code text
	builder.setCodeText(GTIN1);
	// Set Symbology type
	builder.setEncodeType(EncodeTypes.DATABAR_EXPANDED_STACKED);

	builder.setGraphicsUnit(GraphicsUnit.Millimeter);
	builder.setAutoSize(true);
	//builder.setColumns(6);
	
	builder.setxDimension(0.254f);
	builder.setBarHeight(65.02f);

	int cols = builder.getColumns();
	int rows = builder.getRows();
	builder.setRows(7);
	try {
		builder.save("c:\\temp\\DATABAR_EXPANDED_STACKED-" + GTIN1+"-" + ".svg", BarCodeImageFormat.Svg);
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}

@justinwang191,

We are checking your requirement and will update you soon.

Thank you in advance for the help!

Any update this time thanks.

@justinwang191,

We were able to reproduce the same issue and it has been logged into our issue tracking system as BARCODEJAVA-524. We will investigate the issue further and will include the fix in a future version. We will keep you updated on this issue in this thread.

@justinwang191,

Encoded text affects rows count. GTIN1 that you provided according to GS1 encodes into 33 elements. That 33 elements can’t be drawn in 7 lines cause each line except last have to contain even number of elements and also last line can’t contain more elements than above lines. So there is no possibility to draw your barcode in 7 lines. We will introduce exception for this case with the text: “Databar Expanded Stacked - can’t create barcode with specified Rows count.” to avoid any confusion.