@@ -0,0 +1,878 @@
+package com.aspose.barcode.examples.barcode.advanced_features;%0A%0Aimport java.io.IOException;%0A%0Aimport com.aspose.barcode.examples.Utils;%0Aimport com.aspose.barcode.generation.BarcodeGenerator;%0A%0Apublic class BarcodeWithSegments %7B%0A%0A%09public static void main(String%5B%5D args) throws IOException %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09// ExStart: BarcodeWithSegments%0A%0A%09%09// The path to the resource directory.%0A%09%09String dataDir = Utils.getDataDir(SupplementData.class) + %22Barcode/AdvancedFeatures/%22;%0A%0A%09%09BarcodeGenerator generator = new BarcodeGenerator(com.aspose.barcode.EncodeTypes.DATABAR_EXPANDED_STACKED,%0A%09%09%09%09%22(01)98898765432106(3202)012345(15)991231%22);%0A%0A%09%09// Set the column property to define segments per row%0A%09%09generator.getParameters().getBarcode().getDataBar().setColumns(6);%0A%0A%09%09// Save the image%0A%09%09generator.save(dataDir + %226segmets.png%22);%0A%09%09// ExEnd: BarcodeWithSegments%0A%09%7D%0A%0A%7D%0A

Create BarcodeWithSegments.java