www.jpct.net

General => Feedback => Topic started by: Melssj5 on November 11, 2008, 09:33:23 pm

Title: Barcode generation for J2me
Post by: Melssj5 on November 11, 2008, 09:33:23 pm
Hi, This is a not jpct related question, but feeback says: ANYTHING THAT WONT FIT IN THE OTHER FORUMS.   :o


Does anybody know an API to generate barcode images from a given 13 digits number in j2me.

I have been reading with no luck.
Title: Re: Barcode generation for J2me
Post by: influt on November 11, 2008, 11:12:09 pm
Hello, i've had a similar task once. And my solution was not to search for apis, but to code it myself  ;D It's not so hard, you just have to read UPC or EAN documentation, all algorhythms are described there.
Title: Re: Barcode generation for J2me
Post by: Melssj5 on November 11, 2008, 11:14:10 pm
I was reading but had no luck finding a good doc.  Now I downloaded a code 39 font and I am trying to get the images for each char and pass it to paint, but I am afraid it wont result. :S

Any recomended tutorial for it?
Title: Re: Barcode generation for J2me
Post by: influt on November 11, 2008, 11:20:53 pm
A font is a solution, i used it in j2se with success, but I haven't tried it in mobile java. And yes, i think it would be too expensive for a mobile device to store images for each char. I have a good document that describes EAN construction algorhythm at work. Besides, barcode construction algorhythms are quite similar for some groups of barcodes, so i can send this doc to you tommorow, if you need it.
Title: Re: Barcode generation for J2me
Post by: Melssj5 on November 12, 2008, 08:26:15 pm
Can I pass to your office so you can lend me the document? Or can you please post it!  :o
Title: Re: Barcode generation for J2me
Post by: Hrolf on November 13, 2008, 03:39:23 am
I haven't tried it but might this (http://jbars.sourceforge.net) do it?
Title: Re: Barcode generation for J2me
Post by: influt on November 14, 2008, 10:54:15 am
check your mail, Melssj5
Title: Re: Barcode generation for J2me
Post by: Melssj5 on November 14, 2008, 03:25:09 pm
Hi, I checked JBars but it uses a servlet to generate the label and then just send it. Is not what I needed. I already checked the mail, and thanks a lot for that piece of code, I will use it later becausse the project is delayed by the customer so the emergency passed.
Title: Re: Barcode generation for J2me
Post by: Hrolf on November 14, 2008, 10:42:06 pm
I checked JBars but it uses a servlet to generate the label and then just send it.

Not so! You can download and examine the sourcecode which gives you;

Code: [Select]
public static synchronized Image createImage (String codeType, String codeValue)
With loads of variations (colours, rotations &c)