Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > writing barcodes to a window using only clientside javascript

Reply
Thread Tools

writing barcodes to a window using only clientside javascript

 
 
dan
Guest
Posts: n/a
 
      05-22-2009
I have to write a little javascript code that throws up a window with
some text and barcodes in it (which can later be printed out).

Right now i'm creating the the barcodes by essentially
generating html snippets of the form
<img src="http://path/to/gnubarcode/based/software?code=.....">
i.e., i'm essentially serving the barcodes from another script.

But this is pretty unsatisfactory because it forces a pure
clientside routine to have to go out and rely on some web server
to get an image of a barcode. The clients are all running on
machines that have plenty of horsepower for generating barcodes.

So i'm looking for some javascript library that can take a string
and generate a barcode for it. This should be free software
(gpl or other free license). It only has to work on firefox 3, i.e.,
i'm not aiming for great portability here---in fact, i know
essentially all the machines it will run on.

Thanks in advance for any info or advice about this, or even a good
way to google for an existing free software solution.

dan
 
Reply With Quote
 
 
 
 
RobG
Guest
Posts: n/a
 
      05-22-2009
On May 22, 3:51 pm, dan <(E-Mail Removed)> wrote:
> I have to write a little javascript code that throws up a window with
> some text and barcodes in it (which can later be printed out).
>
> Right now i'm creating the the barcodes by essentially
> generating html snippets of the form
> <img src="http://path/to/gnubarcode/based/software?code=.....">
> i.e., i'm essentially serving the barcodes from another script.
>
> But this is pretty unsatisfactory because it forces a pure
> clientside routine to have to go out and rely on some web server
> to get an image of a barcode. The clients are all running on
> machines that have plenty of horsepower for generating barcodes.
>
> So i'm looking for some javascript library that can take a string
> and generate a barcode for it. This should be free software
> (gpl or other free license). It only has to work on firefox 3, i.e.,
> i'm not aiming for great portability here---in fact, i know
> essentially all the machines it will run on.
>
> Thanks in advance for any info or advice about this, or even a good
> way to google for an existing free software solution.



It depends on what you want, there are dozens of different types of
bar codes[1]


<URL: On May 22, 3:51 pm, dan <(E-Mail Removed)> wrote:
> I have to write a little javascript code that throws up a window with
> some text and barcodes in it (which can later be printed out).
>
> Right now i'm creating the the barcodes by essentially
> generating html snippets of the form
> <img src="http://path/to/gnubarcode/based/software?code=.....">
> i.e., i'm essentially serving the barcodes from another script.
>
> But this is pretty unsatisfactory because it forces a pure
> clientside routine to have to go out and rely on some web server
> to get an image of a barcode. The clients are all running on
> machines that have plenty of horsepower for generating barcodes.
>
> So i'm looking for some javascript library that can take a string
> and generate a barcode for it. This should be free software
> (gpl or other free license). It only has to work on firefox 3, i.e.,
> i'm not aiming for great portability here---in fact, i know
> essentially all the machines it will run on.
>
> Thanks in advance for any info or advice about this, or even a good
> way to google for an existing free software solution.
>
> dan


<URL: On May 22, 3:51 pm, dan <(E-Mail Removed)> wrote:
> I have to write a little javascript code that throws up a window with
> some text and barcodes in it (which can later be printed out).
>
> Right now i'm creating the the barcodes by essentially
> generating html snippets of the form
> <img src="http://path/to/gnubarcode/based/software?code=.....">
> i.e., i'm essentially serving the barcodes from another script.
>
> But this is pretty unsatisfactory because it forces a pure
> clientside routine to have to go out and rely on some web server
> to get an image of a barcode. The clients are all running on
> machines that have plenty of horsepower for generating barcodes.
>
> So i'm looking for some javascript library that can take a string
> and generate a barcode for it. This should be free software
> (gpl or other free license). It only has to work on firefox 3, i.e.,
> i'm not aiming for great portability here---in fact, i know
> essentially all the machines it will run on.
>
> Thanks in advance for any info or advice about this, or even a good
> way to google for an existing free software solution.
>
> dan


On May 22, 3:51 pm, dan <(E-Mail Removed)> wrote:
> I have to write a little javascript code that throws up a window with
> some text and barcodes in it (which can later be printed out).
>
> Right now i'm creating the the barcodes by essentially
> generating html snippets of the form
> <img src="http://path/to/gnubarcode/based/software?code=.....">
> i.e., i'm essentially serving the barcodes from another script.
>
> But this is pretty unsatisfactory because it forces a pure
> clientside routine to have to go out and rely on some web server
> to get an image of a barcode. The clients are all running on
> machines that have plenty of horsepower for generating barcodes.
>
> So i'm looking for some javascript library that can take a string
> and generate a barcode for it. This should be free software
> (gpl or other free license). It only has to work on firefox 3, i.e.,
> i'm not aiming for great portability here---in fact, i know
> essentially all the machines it will run on.



Support for multiple browsers should be trivial, however there are
dozens of different types of bar codes [1]. If you want just one type
of 2D bar code, then likely it won't take much to write a function to
generate them using div elements to create a graphic. If you want to
support multiple bar code types, life gets more difficult. Which one
(s) do you want?

1. <URL: http://www.makebarcode.com/specs/barcodechart.html >


--
Rob
 
Reply With Quote
 
 
 
 
Captain Paralytic
Guest
Posts: n/a
 
      05-22-2009
On 22 May, 06:51, dan <(E-Mail Removed)> wrote:
> Thanks in advance for any info or advice about this, or even a good
> way to google for an existing free software solution.

I can't believe you asked that!

I'll give you a clue, it involves typing the words
javascript barcode
into the google search box!

http://lmgtfy.com/?q=javascript+barcode
 
Reply With Quote
 
dan
Guest
Posts: n/a
 
      05-22-2009
> Support for multiple browsers should be trivial, however there are
> dozens of different types of bar codes [1]. If you want just one type
> of 2D bar code, then likely it won't take much to write a function to
> generate them using div elements to create a graphic. If you want to
> support multiple bar code types, life gets more difficult. Which one
> (s) do you want?
>
> 1. <URL:http://www.makebarcode.com/specs/barcodechart.html>


Hi Rob,

Thanks for your post.

You are right, i should have mentioned which code i'm interested in.

It is 128 (linear, not 2d).

I don't know how hard it would be to handcraft software to do this,
but i would like to use a piece of free software (free as in
freedom) which already exists.

In fact, i am already doing this---i'm using the gnu apparatus
http://www.gnu.org/software/barcode/
I am using it through PHP-Barcode:
http://www.ashberg.de/php-barcode/

It is free software, and very high quality.

However, in order to use it, i have to have a separate piece of
server software running.

I would like to generate all in one process without having
to call out to any external program.

If i can avoid writing any new code i would like to do so. New
code means new errors and new debugging. So if a free software
solution already exists, i would like to use it.

Since genbarcode does exist (C code), i imagine that there may
very well be a piece of pure javascript code which also
exists as free software.

That's why i would appreciate any pointers to a piece of
free-as-in-freedom javascript which draws barcodes.

Thanks in advance if you or anybody else can point me to
such a piece of code.

dan



On May 21, 11:42*pm, RobG <(E-Mail Removed)> wrote:
> On May 22, 3:51 pm, dan <(E-Mail Removed)> wrote:


> > I have to write a little javascript code that throws up a window with
> > some text and barcodes in it (which can later be printed out).

>
> > Right now i'm creating the the barcodes by essentially
> > generating html snippets of the form
> > * <img src="http://path/to/gnubarcode/based/software?code=.....">
> > i.e., i'm essentially serving the barcodes from another script.

>
> > But this is pretty unsatisfactory because it forces a pure
> > clientside routine to have to go out and rely on some web server
> > to get an image of a barcode. *The clients are all running on
> > machines that have plenty of horsepower for generating barcodes.

>
> > So i'm looking for some javascript library that can take a string
> > and generate a barcode for it. *This should be free software
> > (gpl or other free license). *It only has to work on firefox 3, i.e.,
> > i'm not aiming for great portability here---in fact, i know
> > essentially all the machines it will run on.

>
> > Thanks in advance for any info or advice about this, or even a good
> > way to google for an existing free software solution.

>

 
Reply With Quote
 
dan
Guest
Posts: n/a
 
      05-22-2009
On May 22, 7:28*am, Captain Paralytic <(E-Mail Removed)> wrote:
> On 22 May, 06:51, dan <(E-Mail Removed)> wrote:> Thanks in advance for any info or advice about this, or even a good
> > way to google for an existing free software solution.

>
> I can't believe you asked that!
>
> I'll give you a clue, it involves typing the words
> javascript barcode
> into the google search box!
>
> http://lmgtfy.com/?q=javascript+barcode


Hi Captain,

I really like your demo of searching for javascript and barcode in
google.

It is slick. Make that "Slick!!!".

Unfortunately, even your slick way of doing it provides THREE MILLION
hits.

As far as i can tell, 99.9% of them (or maybe all of them) are for
proprietary products.

I already have a mixed language solution made entirely of free
software. (But what i would like is a one-language solution.)

Adding search terms like "gnu" or "free software" helps some, but
tends to just produce pages that list both free and proprietary
products (of which the javascript ones are not free).

But in any event, thanks for that demo, which shows that you're
far more connected to this world than i am.

And if you know of any free-as-in-freedom pure-javascript barcode
generation software, please inform me of it. Even in a plain,
boring, humdrum URL type of way.

dan

PS: Just for reference, the packages i am using are very high
quality. I should have mentioned them for reference:

http://www.gnu.org/software/barcode/
http://www.ashberg.de/php-barcode/

And i only need this to work for code 128, and only on firefox 3.

 
Reply With Quote
 
Captain Paralytic
Guest
Posts: n/a
 
      05-22-2009
On 22 May, 15:45, dan <(E-Mail Removed)> wrote:
> On May 22, 7:28*am, Captain Paralytic <(E-Mail Removed)> wrote:
>
> > On 22 May, 06:51, dan <(E-Mail Removed)> wrote:> Thanks in advance for any info or advice about this, or even a good
> > > way to google for an existing free software solution.

>
> > I can't believe you asked that!

>
> > I'll give you a clue, it involves typing the words
> > javascript barcode
> > into the google search box!

>
> >http://lmgtfy.com/?q=javascript+barcode

>
> Hi Captain,
>
> I really like your demo of searching for javascript and barcode in
> google.
>
> It is slick. *Make that "Slick!!!".
>
> Unfortunately, even your slick way of doing it provides THREE MILLION
> hits.
>
> As far as i can tell, 99.9% of them (or maybe all of them) are for
> proprietary products.

And what was wrong with the very first hit? It seems to do precisely
what you asked for in your post.
 
Reply With Quote
 
dan
Guest
Posts: n/a
 
      05-22-2009
On May 22, 8:29*am, Captain Paralytic <(E-Mail Removed)> wrote:
> On 22 May, 15:45, dan <(E-Mail Removed)> wrote:
>
> > On May 22, 7:28*am, Captain Paralytic <(E-Mail Removed)> wrote:

>
> > > On 22 May, 06:51, dan <(E-Mail Removed)> wrote:> Thanks in advance for any info or advice about this, or even a good
> > > > way to google for an existing free software solution.

>
> > > I can't believe you asked that!

>
> > > I'll give you a clue, it involves typing the words
> > > javascript barcode
> > > into the google search box!

>
> > >http://lmgtfy.com/?q=javascript+barcode

>
> > Hi Captain,

>
> > I really like your demo of searching for javascript and barcode in
> > google.

>
> > It is slick. *Make that "Slick!!!".

>
> > Unfortunately, even your slick way of doing it provides THREE MILLION
> > hits.

>
> > As far as i can tell, 99.9% of them (or maybe all of them) are for
> > proprietary products.

>
> And what was wrong with the very first hit? It seems to do precisely
> what you asked for in your post.


Well, the very first hit is like 99.9% (or maybe 100%??) of the
others:
it is not free-as-in-freedom software.

I have a solution now of 100% free-as-in-freedom software, but it is
mixed language: i would like to go to a pure client-side solution,
using only free-as-in-freedom software.

However, i certainly appreciate your feedback, and your slick demo.
As i say, you are really connected to this milieu.

And if you can point to a free-as-in-freedom software solution
(see http://www.gnu.org/philosophy/free-sw.html from the
awesome Free Software Foundation [http://www.fsf.org/])
i would appreciate it.

dan

 
Reply With Quote
 
Carlos JP
Guest
Posts: n/a
 
      05-22-2009
On May 22, 4:41*pm, dan <(E-Mail Removed)> wrote:
> Well, the very first hit is like 99.9% (or maybe 100%??) of the
> others:
> it is not free-as-in-freedom software.
>

Did you see this first hit? http://www.parkscomputing.com/barcode.html

 
Reply With Quote
 
dan
Guest
Posts: n/a
 
      05-22-2009
On May 22, 8:52*am, Carlos JP <(E-Mail Removed)> wrote:
> On May 22, 4:41*pm, dan <(E-Mail Removed)> wrote:> Well, the very first hit is like 99.9% (or maybe 100%??) of the
> > others:
> > it is not free-as-in-freedom software.

>
> Did you see this first hit?http://www.parkscomputing.com/barcode.html


Carlos --- thank you so much.

It wasn't the first hit on mine --- i got one of those ID Automation
things.

Now, this is EAN, and i want code 128, but the idea is exactly right:
the
page draws the graphics without having to do a GET from something
else.

If somebody knows of a 128, please let me know, but i can look at this
anyway to see if i can adapt it.

Thanks again!

dan
 
Reply With Quote
 
Bart Van der Donck
Guest
Posts: n/a
 
      05-23-2009
dan wrote:

> I have to write a little javascript code that throws up a window with
> some text and barcodes in it (which can later be printed out).
>
> Right now i'm creating the the barcodes by essentially
> generating html snippets of the form
> * <img src="http://path/to/gnubarcode/based/software?code=.....">
> i.e., i'm essentially serving the barcodes from another script.
>
> But this is pretty unsatisfactory because it forces a pure
> clientside routine to have to go out and rely on some web server
> to get an image of a barcode. *The clients are all running on
> machines that have plenty of horsepower for generating barcodes.
>
> So i'm looking for some javascript library that can take a string
> and generate a barcode for it. *This should be free software
> (gpl or other free license). *It only has to work on firefox 3, i.e.,
> i'm not aiming for great portability here---in fact, i know
> essentially all the machines it will run on.
>
> Thanks in advance for any info or advice about this, or even a good
> way to google for an existing free software solution.


I don't know if this is suitable for you, but the Google Charts API
provides in barcodes, albeit in the QR-encoding:
http://code.google.com/intl/nl-NL/ap...s.html#qrcodes

Example (QR) barcode for "some text":
http://chart.apis.google.com/chart?c...hl=some%20text

Code-128 is unfortunately (still?) not possible; I posted a request to
the 'Google Chart API' group in 2008:
http://groups.google.com/group/googl...481359b8829d1/
http://groups.google.com/group/googl...6083aa6b?hl=en

--
Bart
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generate Barcodes with Custom width & ECC Standards for 2D Barcodes sherazam Java 1 05-06-2013 02:41 AM
adding items to a listbox using clientside javascript bill ASP .Net 1 06-16-2006 07:39 PM
Barcodes MDB ASP .Net 1 01-27-2006 01:55 AM
What do the barcodes on the movie disks mean? KublaiKhan DVD Video 0 08-14-2004 02:05 AM
barcodes/upc question/help Dale Java 3 11-13-2003 09:19 AM



Advertisments