title: Generate GS1 databar expand Barcode in Java?
body: <p>I wan't to generate a Barcode which is type of GS1 databar expanded. I'm searched in google and didn't found realy working results. I discover that ZXing gives the possibility to generate different barcodes. I wrote an small code and i can generate barcode for ean128.</p>
  
  <pre><code>package de..barcodee128;
  import java.io.File;
  import java.io.FileOutputStream;
  import com.google.zxing.BarcodeFormat;
  import com.google.zxing.WriterException;
  import com.google.zxing.client.j2se.MatrixToImageWriter;
  import com.google.zxing.common.BitMatrix;
  import com.google.zxing.oned.Code128Writer;
  import com.google.zxing.oned.Code39Writer;
  import com.google.zxing.oned.OneDimensionalCodeWriter;
  import com.google.zxing.oned.rss.expanded.decoders.AbstractExpandedDecoder;
  
  public class barcode128 {
      public static void main(String[] args) {
  
             int width = 440; 
             int height = 48;
  
  
             BitMatrix bitMatrix;
          try {
              bitMatrix = new Code128Writer().encode("10400550006232515201231",BarcodeFormat.RSS_EXPANDED,width,height,null);
              MatrixToImageWriter.writeToStream(bitMatrix, "png", new FileOutputStream(new File("C:\\Users\\fecub\\Desktop\\zxing_barcode.png")));
          } catch (WriterException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          } 
  
      }
  
  }
  </code></pre>
  
  <p>But my question is how to modify this code that gives me to possibility to create GS1 databar expanded barcodes? any idea??</p>