Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Generate Barcode wih XZing

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Generate Barcode wih XZing

    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.

    package de.olgun.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();
            } 
     
        }
     
    }

    But my question is how to modify this code that gives me to possibility to create GS1 databar expanded barcodes.


  2. #2
    Junior Member
    Join Date
    Aug 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Generate Barcode wih XZing

    Why not try another EAN 128 barcode generator which supports this functionality?

Similar Threads

  1. Increase the barcode width in Java
    By astridcollins787 in forum JavaServer Pages: JSP & JSTL
    Replies: 6
    Last Post: December 7th, 2012, 03:37 AM
  2. Barcode Generator
    By StarRocks in forum JDBC & Databases
    Replies: 4
    Last Post: August 27th, 2012, 12:35 AM
  3. Using barcode to input data
    By cnjiru in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: August 7th, 2012, 07:10 AM
  4. How can we read barcode in pdf file?
    By suresh.bellala in forum Member Introductions
    Replies: 3
    Last Post: July 6th, 2012, 04:58 AM
  5. Help wih implementation...
    By Frank_nor in forum What's Wrong With My Code?
    Replies: 4
    Last Post: November 24th, 2009, 05:43 PM

Tags for this Thread