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 13 of 13

Thread: Barcode Generator

  1. #1
    Junior Member
    Join Date
    Aug 2012
    Posts
    8
    My Mood
    Cheeky
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Red face Barcode Generator

    Dear Forums,


    Hi guys im very new to this forum.......h r u guys....Hey Guys i want some information related to Barcode Generator do anyone know how to create a barcode using Java .....Any solution would be appreciable......Thanks in Advance.


    Regards......

    Venu


  2. #2
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,777
    Thanks
    25
    Thanked 348 Times in 323 Posts

    Default Re: Barcode Generator

    I don't personally know how to create Barcodes, but this website should give you all the libraries and documentation that you would ever want: TWiki . Javapedia . Barcode
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  3. #3
    Junior Member
    Join Date
    Aug 2012
    Posts
    8
    My Mood
    Cheeky
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Barcode Generator

    Dear aussiemcgr,

    Thanks for the reply...I have done the coding in .Net when it comes to Java i have issues like code not getting executed correctly i have given part of the code here coz i cant produce the entire code right.....please have a look at the below code...



     
     
    public class BarCodeVerifier {
    	int nAPMCCode = 0; 
    	int nDate = 0; 
    	int nMonth = 0; 
    	int nTime = 0; 
    	int nTrader = 0; 
    	int nLorry = 0; 
    	int nCommodity = 0; 
    	int nQuantity = 0; 
    	int nMinute = 0;
    	//String dt = DateFormat.getDateInstance().format(new Date()); // DateTime.Now.ToLongDateString();
     
     
     
    	public BarCodeVerifier() {
    	}
     
    	public int[] GetDecodedData(String strCoded) {
     
    		int[] nArr = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
    		// strip the last char...
    		char c = strCoded.toCharArray()[strCoded.length() - 1];
    		if (strCoded.length() > 17) {
    			String strMinuteCode = strCoded.substring(15, 17);
    			int nMunite = (int) (Base36Decode(strMinuteCode));
    			strCoded = new String(strCoded.substring(0, strCoded.length() - 3));
    			nArr[8] = nMunite;
    		} else {
    			strCoded = strCoded.substring(0, strCoded.length() - 1);
    			nArr[8] = 0;
    		}
    		// char c = strCoded.ToCharArray()[strCoded.Length-1];
    		// strCoded = strCoded.substring(0,strCoded.length()-1);
     
    		int nTime = (int) Base36Decode(String.valueOf(c));
    		int nTemp = (nTime < 15) ? (15 - nTime) : (15 - (nTime - 15));
    		strCoded = RotateString(strCoded, nTemp);
    		nArr[0] = (int) (Base36Decode(strCoded.substring(0, 2))); 
    		nArr[1] = (int) (Base36Decode(strCoded.substring(2, 3))); 
    		nArr[2] = (int) (Base36Decode(strCoded.substring(3, 4))); 
    		nArr[3] = nTime; // Time
    		nArr[4] = (int) (Base36Decode(strCoded.substring(4, 7))); 
    		nArr[5] = (int) (Base36Decode(strCoded.substring(7, 10))); 
    		nArr[6] = (int) (Base36Decode(strCoded.substring(10, 12))); 
    		// CODE
    		nArr[7] = (int) (Base36Decode(strCoded.substring(12, 15))); 
     
     
     
    		return nArr;
    	}
     
    	// Converts base36 string to int64 string .. All capitals
     
    	public static long Base36Decode(String input) {
    		/*
    		 * This function converts the input String characters into base36 values
    		 */
    		String base36Chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    		char[] arrInput = new char[input.length()];
    		arrInput=input.toCharArray();
    		for (int i = input.length() - 1, j = 0; i != -1; i--, j++) {
    			arrInput[j] = input.charAt(i);
    		}
    		long returnValue = 0, rv=0;;
    		int value=1;
    		for (int i = 0; i < arrInput.length; i++) {
     
    			int valueindex = base36Chars.indexOf(arrInput[i]);
    			if(i==0)
    			{
    				rv=valueindex;
    			}
    			else
    			{
    			for(int j=0;j<=i;j++)
     
    			{
    				   if(j==0)
    					{
    						value=1;
    					}
    					else
    					{
    					value*=36;
    					}
     
    			}
    			returnValue+= valueindex*value;
    			}
    		}
    		return rv+returnValue;
    	}
    	private String RotateString(String strRotate, int nTimes) {
    		/*
    		 * Function can Rotates the String
    		 */
    		char[] cTemp;
    		char cur, nxt;
    		int nLen = strRotate.length();
    		for (int nIndex = 0; nIndex < nTimes; nIndex++) {
    			cTemp = strRotate.toCharArray();
    			cur = cTemp[0];
    			nxt = cur;
    			for (int nTemp = 0; nTemp < nLen - 1; nTemp++) {
    				nxt = cTemp[nTemp + 1];
    				cTemp[nTemp + 1] = cur;
    				cur = nxt;
    			}
    			cTemp[0] = nxt;
    			strRotate = new String(cTemp);
    		}
     
    		return strRotate;
    	}
     
    }

    My code may not be correct...And my output is it should display me a barcode as of now and when i scan it,it should display me the details related to that barcode...As of now it should create me a barcode........Any Solution would be appreciable....Thanks in Advance....


    Regards,
    Last edited by StarRocks; August 24th, 2012 at 06:10 AM.

  4. #4
    Junior Member
    Join Date
    Aug 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Barcode Generator

    Quote Originally Posted by StarRocks View Post
    Dear Forums,


    Hi guys im very new to this forum.......h r u guys....Hey Guys i want some information related to Barcode Generator do anyone know how to create a barcode using Java .....Any solution would be appreciable......Thanks in Advance.


    Regards......

    Venu
    I have used Barcode4j (Welcome to Barcode4J). Works very well.

  5. #5
    Junior Member
    Join Date
    Aug 2012
    Posts
    8
    My Mood
    Cheeky
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Barcode Generator

    Dear paulvas,


    Thanks for the reply.....Will get back to you if i have any futher queries.......If you find any other solutions please forward me....Any solution would be appreciable......Thanks in Advance...


    Regards,

    Venu

  6. #6
    Junior Member
    Join Date
    Dec 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Barcode Generator

    One solution is to integrate a barcode library into Java application. Look at the Java barcode library and tutorial of creating barcode image using barcode library in Java.

  7. #7
    Junior Member
    Join Date
    Dec 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Barcode Generator

    It is a easy way to create barcode in Java by using a barcode image library for Java. Code 39 and Code 128 have a very common use. Please refer to the Code 39 image processing library for Java.

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

    Default Re: Barcode Generator

    Barcode Generator for Java is a Java Barcode Generation library package, which generates Code 39, Code 128, GS1-128, UPC/EAN Linear (1D) and QR Code, Data Matrix, PDF 417 Matrix (2D) barcodes in Java applications.
    Java Barcode Generator can be used on any platform with a Java Virtual Machine, including Windows, Linux, Unix, MacOS, Solaris, and HP/UX.

  9. #9

    Default Re: Barcode Generator

    Hi Venu,

    As for bar code project for Java, you may try to search the barcode tutorial with simple steps and Java codes for barcode generating.
    Java barcode developer

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

    Default Re: Barcode Generator

    I recommen this online free barcode generator to you, you can have a test, wish you good luck.

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

    Default Re: Barcode Generator

    Quote Originally Posted by StarRocks View Post
    Dear Forums,


    Hi guys im very new to this forum.......h r u guys....Hey Guys i want some information related to Barcode Generator do anyone know how to create a barcode using Java .....Any solution would be appreciable......Thanks in Advance.


    Regards......

    Venu
    Hi, it's easy to create barcode in Java.You can use a third party control. Firstly, you should know which kind of barcode you want to create. For example, if you want to create QR Code barcode in Java, you can try to find a Java QR Code barcode generator in Google. If you want to create Code 128 in Java, you can put Java Code 128 barcode generator in Google. You will find what you want.

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

    Default Re: Barcode Generator

    Quote Originally Posted by StarRocks View Post
    Dear Forums,


    Hi guys im very new to this forum.......h r u guys....Hey Guys i want some information related to Barcode Generator do anyone know how to create a barcode using Java .....Any solution would be appreciable......Thanks in Advance.


    Regards......

    Venu
    Hi, I used this Java Servlet barcode generator library. You may take a look. If you want to know how to create barcode in Java, you may read this passage called encoding barcode data in Java turoial.

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

    Default Re: Barcode Generator

    This page might help .Generate and Print 1D and 2D Barcodes in Java

Similar Threads

  1. Increase the barcode width in Java
    By astridcollins787 in forum JavaServer Pages: JSP & JSTL
    Replies: 7
    Last Post: February 5th, 2013, 01:29 AM
  2. Java Barcode Program with Oracle database
    By techsing14 in forum JavaServer Pages: JSP & JSTL
    Replies: 3
    Last Post: December 6th, 2012, 05:19 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, 08: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, 05:58 AM
  5. Replies: 0
    Last Post: January 25th, 2011, 01:24 AM